This commit adds a batch of GraphicsFuzz coverage tests.
Components: Vulkan
New Tests:
dEQP-VK.graphicsfuzz.cov-function-nested-loops-limit-uniform-xor-uniform
dEQP-VK.graphicsfuzz.cov-loop-array-index-decrement-never-negative
dEQP-VK.graphicsfuzz.cov-loop-condition-filter-some-iterations-never-discard
dEQP-VK.graphicsfuzz.cov-loop-increase-iterator-condition-uniform-copy-array-elements
dEQP-VK.graphicsfuzz.cov-loop-iterator-plus-one-variable-outside-index-array
dEQP-VK.graphicsfuzz.cov-loop-limiter-min-findlsb
dEQP-VK.graphicsfuzz.cov-loop-limiter-uniform-bitwise-and-one-always-break
dEQP-VK.graphicsfuzz.cov-loop-replace-output-color-restore-original
dEQP-VK.graphicsfuzz.cov-negative-integer-bitwise-or-uniform-increment-loop
dEQP-VK.graphicsfuzz.cov-nested-loops-copy-array-elements-skip-first
dEQP-VK.graphicsfuzz.cov-nested-loops-fragcoord-never-return-descending-loop
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-output-color-from-backup
dEQP-VK.graphicsfuzz.cov-nested-loops-identical-iterator-names-multiply-divide
dEQP-VK.graphicsfuzz.cov-two-functions-modify-struct-array-element-return-from-loop
dEQP-VK.graphicsfuzz.cov-vec2-dot-max-uniform
Change-Id: I3694d496c3e26f4fc429ac69161bb49d1cb6e9b8
dEQP-VK.graphicsfuzz.cov-function-loop-same-conditions-multiple-times-struct-array
dEQP-VK.graphicsfuzz.cov-function-nested-do-whiles-looped-once
dEQP-VK.graphicsfuzz.cov-function-nested-loops-break-early-never-discard
+dEQP-VK.graphicsfuzz.cov-function-nested-loops-limit-uniform-xor-uniform
dEQP-VK.graphicsfuzz.cov-function-trivial-switch-case
dEQP-VK.graphicsfuzz.cov-function-two-loops-limit-using-arguments-array-element-copies
dEQP-VK.graphicsfuzz.cov-function-undefined-shift-left-index-array-with-return-value
dEQP-VK.graphicsfuzz.cov-left-shift-right-shift-compare
dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
dEQP-VK.graphicsfuzz.cov-loop-array-element-copy-index-clamp-sign
+dEQP-VK.graphicsfuzz.cov-loop-array-index-decrement-never-negative
dEQP-VK.graphicsfuzz.cov-loop-break-after-first-iteration-set-array-element
dEQP-VK.graphicsfuzz.cov-loop-break-floor-nan-never-executed
dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
dEQP-VK.graphicsfuzz.cov-loop-condition-clamp-vec-of-ones
dEQP-VK.graphicsfuzz.cov-loop-condition-divide-by-uniform-always-false
dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
+dEQP-VK.graphicsfuzz.cov-loop-condition-filter-some-iterations-never-discard
dEQP-VK.graphicsfuzz.cov-loop-condition-logical-or-never-iterated
dEQP-VK.graphicsfuzz.cov-loop-dfdx-constant-divide
dEQP-VK.graphicsfuzz.cov-loop-exit-conditions-sampler-struct-integer-variable
dEQP-VK.graphicsfuzz.cov-loop-divide-uninitialized-vector-min-unused
dEQP-VK.graphicsfuzz.cov-loop-fragcoord-identical-condition
+dEQP-VK.graphicsfuzz.cov-loop-increase-iterator-condition-uniform-copy-array-elements
dEQP-VK.graphicsfuzz.cov-loop-increment-array-elements-clamp-index
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-findmsb-minus-uniform
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-set-output-color-break
dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
dEQP-VK.graphicsfuzz.cov-loop-integer-half-minus-one
+dEQP-VK.graphicsfuzz.cov-loop-iterator-plus-one-variable-outside-index-array
+dEQP-VK.graphicsfuzz.cov-loop-limiter-min-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-limiter-uniform-bitwise-and-one-always-break
dEQP-VK.graphicsfuzz.cov-loop-logical-xor
+dEQP-VK.graphicsfuzz.cov-loop-replace-output-color-restore-original
dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
dEQP-VK.graphicsfuzz.cov-loop-set-vector-components-pow-two
dEQP-VK.graphicsfuzz.cov-loop-start-from-one-switch-case-invalid-color-never-executed
dEQP-VK.graphicsfuzz.cov-multiple-fragcoord-conditions-never-return-color-uninitialized
dEQP-VK.graphicsfuzz.cov-multiple-loops-same-condition-always-false-global-loop-counter
dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-negative-integer-bitwise-or-uniform-increment-loop
dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
dEQP-VK.graphicsfuzz.cov-nested-functions-compare-fragcood-length-zero-vector
dEQP-VK.graphicsfuzz.cov-nested-functions-loop-assign-global-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-not-greater-than-increment-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
dEQP-VK.graphicsfuzz.cov-nested-loops-clamp-ivec-push-constant-increment-global-counter
+dEQP-VK.graphicsfuzz.cov-nested-loops-copy-array-elements-skip-first
dEQP-VK.graphicsfuzz.cov-nested-loops-different-iteration-rates-function-copy-array-elements
dEQP-VK.graphicsfuzz.cov-nested-loops-divide-integer-constant-always-zero
dEQP-VK.graphicsfuzz.cov-nested-loops-decrease-vector-component-by-matrix-element-global-loop-counter
dEQP-VK.graphicsfuzz.cov-nested-loops-float-array-select-by-fragcoord
dEQP-VK.graphicsfuzz.cov-nested-loops-float-bits-to-int-increment-array
+dEQP-VK.graphicsfuzz.cov-nested-loops-fragcoord-never-return-descending-loop
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-func-set-struct-field
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-increment-single-element
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-fragcoord-negative-always-false
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-iterator-dependency
+dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-output-color-from-backup
+dEQP-VK.graphicsfuzz.cov-nested-loops-identical-iterator-names-multiply-divide
dEQP-VK.graphicsfuzz.cov-nested-loops-increase-integer-dot-product
dEQP-VK.graphicsfuzz.cov-nested-loops-redundant-condition
dEQP-VK.graphicsfuzz.cov-nested-loops-sample-opposite-corners
dEQP-VK.graphicsfuzz.cov-texel-double-negation
dEQP-VK.graphicsfuzz.cov-transpose-multiply
dEQP-VK.graphicsfuzz.cov-trunc-fract-always-zero
+dEQP-VK.graphicsfuzz.cov-two-functions-modify-struct-array-element-return-from-loop
dEQP-VK.graphicsfuzz.cov-two-loops-global-loop-counter-shift-right-zero-increment-array-element
dEQP-VK.graphicsfuzz.cov-two-nested-loops-switch-case-matrix-array-increment
dEQP-VK.graphicsfuzz.cov-ucarryadd-one-and-one
dEQP-VK.graphicsfuzz.cov-unused-access-past-matrix-elements
dEQP-VK.graphicsfuzz.cov-unused-matrix-copy-inside-loop
dEQP-VK.graphicsfuzz.cov-variable-copy-in-function-tex-sample
+dEQP-VK.graphicsfuzz.cov-vec2-dot-max-uniform
dEQP-VK.graphicsfuzz.cov-vec2-dot-minus-negative-zero
dEQP-VK.graphicsfuzz.cov-vec2-duplicate-min-always-half
dEQP-VK.graphicsfuzz.cov-vector-illegal-index-never-executed
dEQP-VK.graphicsfuzz.cov-function-loop-same-conditions-multiple-times-struct-array
dEQP-VK.graphicsfuzz.cov-function-nested-do-whiles-looped-once
dEQP-VK.graphicsfuzz.cov-function-nested-loops-break-early-never-discard
+dEQP-VK.graphicsfuzz.cov-function-nested-loops-limit-uniform-xor-uniform
dEQP-VK.graphicsfuzz.cov-function-trivial-switch-case
dEQP-VK.graphicsfuzz.cov-function-two-loops-limit-using-arguments-array-element-copies
dEQP-VK.graphicsfuzz.cov-function-undefined-shift-left-index-array-with-return-value
dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
dEQP-VK.graphicsfuzz.cov-loop-array-element-copy-index-clamp-sign
+dEQP-VK.graphicsfuzz.cov-loop-array-index-decrement-never-negative
dEQP-VK.graphicsfuzz.cov-loop-break-after-first-iteration-set-array-element
dEQP-VK.graphicsfuzz.cov-loop-break-floor-nan-never-executed
dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
dEQP-VK.graphicsfuzz.cov-loop-condition-clamp-vec-of-ones
dEQP-VK.graphicsfuzz.cov-loop-condition-divide-by-uniform-always-false
dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
+dEQP-VK.graphicsfuzz.cov-loop-condition-filter-some-iterations-never-discard
dEQP-VK.graphicsfuzz.cov-loop-condition-logical-or-never-iterated
dEQP-VK.graphicsfuzz.cov-loop-dfdx-constant-divide
dEQP-VK.graphicsfuzz.cov-loop-exit-conditions-sampler-struct-integer-variable
dEQP-VK.graphicsfuzz.cov-loop-divide-uninitialized-vector-min-unused
dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
dEQP-VK.graphicsfuzz.cov-loop-fragcoord-identical-condition
+dEQP-VK.graphicsfuzz.cov-loop-increase-iterator-condition-uniform-copy-array-elements
dEQP-VK.graphicsfuzz.cov-loop-increment-array-elements-clamp-index
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-findmsb-minus-uniform
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-set-output-color-break
dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
dEQP-VK.graphicsfuzz.cov-loop-integer-half-minus-one
+dEQP-VK.graphicsfuzz.cov-loop-iterator-plus-one-variable-outside-index-array
+dEQP-VK.graphicsfuzz.cov-loop-limiter-min-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-limiter-uniform-bitwise-and-one-always-break
dEQP-VK.graphicsfuzz.cov-loop-logical-xor
+dEQP-VK.graphicsfuzz.cov-loop-replace-output-color-restore-original
dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
dEQP-VK.graphicsfuzz.cov-loop-set-vector-components-pow-two
dEQP-VK.graphicsfuzz.cov-loop-start-from-one-switch-case-invalid-color-never-executed
dEQP-VK.graphicsfuzz.cov-multiple-fragcoord-conditions-never-return-color-uninitialized
dEQP-VK.graphicsfuzz.cov-multiple-loops-same-condition-always-false-global-loop-counter
dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-negative-integer-bitwise-or-uniform-increment-loop
dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
dEQP-VK.graphicsfuzz.cov-nested-functions-compare-fragcood-length-zero-vector
dEQP-VK.graphicsfuzz.cov-nested-functions-loop-assign-global-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-not-greater-than-increment-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
dEQP-VK.graphicsfuzz.cov-nested-loops-clamp-ivec-push-constant-increment-global-counter
+dEQP-VK.graphicsfuzz.cov-nested-loops-copy-array-elements-skip-first
dEQP-VK.graphicsfuzz.cov-nested-loops-different-iteration-rates-function-copy-array-elements
dEQP-VK.graphicsfuzz.cov-nested-loops-divide-integer-constant-always-zero
dEQP-VK.graphicsfuzz.cov-nested-loops-decrease-vector-component-by-matrix-element-global-loop-counter
dEQP-VK.graphicsfuzz.cov-nested-loops-float-array-select-by-fragcoord
dEQP-VK.graphicsfuzz.cov-nested-loops-float-bits-to-int-increment-array
+dEQP-VK.graphicsfuzz.cov-nested-loops-fragcoord-never-return-descending-loop
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-func-set-struct-field
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-increment-single-element
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-fragcoord-negative-always-false
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-iterator-dependency
+dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-output-color-from-backup
+dEQP-VK.graphicsfuzz.cov-nested-loops-identical-iterator-names-multiply-divide
dEQP-VK.graphicsfuzz.cov-nested-loops-increase-integer-dot-product
dEQP-VK.graphicsfuzz.cov-nested-loops-redundant-condition
dEQP-VK.graphicsfuzz.cov-nested-loops-sample-opposite-corners
dEQP-VK.graphicsfuzz.cov-texel-double-negation
dEQP-VK.graphicsfuzz.cov-transpose-multiply
dEQP-VK.graphicsfuzz.cov-trunc-fract-always-zero
+dEQP-VK.graphicsfuzz.cov-two-functions-modify-struct-array-element-return-from-loop
dEQP-VK.graphicsfuzz.cov-two-loops-global-loop-counter-shift-right-zero-increment-array-element
dEQP-VK.graphicsfuzz.cov-two-nested-loops-switch-case-matrix-array-increment
dEQP-VK.graphicsfuzz.cov-types-return-in-main-never-hit
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
dEQP-VK.graphicsfuzz.cov-value-tracking-uniform-incident
dEQP-VK.graphicsfuzz.cov-variable-copy-in-function-tex-sample
+dEQP-VK.graphicsfuzz.cov-vec2-dot-max-uniform
dEQP-VK.graphicsfuzz.cov-vec2-dot-minus-negative-zero
dEQP-VK.graphicsfuzz.cov-vec2-duplicate-min-always-half
dEQP-VK.graphicsfuzz.cov-vector-dce-inc-unused-comp
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of one: 1
+# layout(push_constant) uniform buf_push
+# {
+# int one;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# int func(float x)
+# {
+# vec2 v = vec2(_float_1_0);
+#
+# // Always true.
+# while(one >= 1)
+# {
+# // Always true.
+# if(v.x > _float_0_0)
+# {
+# int a = 1;
+#
+# // Iterates twice.
+# for(int i = _int_0; i < _int_2; i++)
+# {
+# // Iterates once.
+# for(int j = _int_1; j != (_int_1 ^ one); j--)
+# {
+# // Iterates twice when this block is first executed.
+# while(a >= 0)
+# {
+# x = _float_1_0;
+# a--;
+# }
+# }
+# }
+#
+# // Always true.
+# if (a == -1)
+# return 1;
+#
+# // Never executed.
+# v = vec2(x);
+# }
+# }
+#
+# // Never executed.
+# return _int_0;
+# }
+#
+# void main()
+# {
+# int a = _int_0;
+# int b = func(_float_0_0);
+# _GLF_color = vec4(b, a, a, b);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 132
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %122
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %11 "func(f1;"
+ OpName %10 "x"
+ OpName %15 "v"
+ OpName %19 "buf1"
+ OpMemberName %19 0 "_GLF_uniform_float_values"
+ OpName %21 ""
+ OpName %32 "buf_push"
+ OpMemberName %32 0 "one"
+ OpName %34 ""
+ OpName %50 "a"
+ OpName %51 "i"
+ OpName %54 "buf0"
+ OpMemberName %54 0 "_GLF_uniform_int_values"
+ OpName %56 ""
+ OpName %70 "j"
+ OpName %112 "a"
+ OpName %115 "b"
+ OpName %116 "param"
+ OpName %122 "_GLF_color"
+ OpDecorate %18 ArrayStride 16
+ OpMemberDecorate %19 0 Offset 0
+ OpDecorate %19 Block
+ OpDecorate %21 DescriptorSet 0
+ OpDecorate %21 Binding 1
+ OpMemberDecorate %32 0 Offset 0
+ OpDecorate %32 Block
+ OpDecorate %53 ArrayStride 16
+ OpMemberDecorate %54 0 Offset 0
+ OpDecorate %54 Block
+ OpDecorate %56 DescriptorSet 0
+ OpDecorate %56 Binding 0
+ OpDecorate %122 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %8 = OpTypeInt 32 1
+ %9 = OpTypeFunction %8 %7
+ %13 = OpTypeVector %6 2
+ %14 = OpTypePointer Function %13
+ %16 = OpTypeInt 32 0
+ %17 = OpConstant %16 2
+ %18 = OpTypeArray %6 %17
+ %19 = OpTypeStruct %18
+ %20 = OpTypePointer Uniform %19
+ %21 = OpVariable %20 Uniform
+ %22 = OpConstant %8 0
+ %23 = OpTypePointer Uniform %6
+ %32 = OpTypeStruct %8
+ %33 = OpTypePointer PushConstant %32
+ %34 = OpVariable %33 PushConstant
+ %35 = OpTypePointer PushConstant %8
+ %38 = OpConstant %8 1
+ %39 = OpTypeBool
+ %41 = OpConstant %16 0
+ %49 = OpTypePointer Function %8
+ %52 = OpConstant %16 3
+ %53 = OpTypeArray %8 %52
+ %54 = OpTypeStruct %53
+ %55 = OpTypePointer Uniform %54
+ %56 = OpVariable %55 Uniform
+ %57 = OpTypePointer Uniform %8
+ %66 = OpConstant %8 2
+ %101 = OpConstant %8 -1
+ %120 = OpTypeVector %6 4
+ %121 = OpTypePointer Output %120
+ %122 = OpVariable %121 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %112 = OpVariable %49 Function
+ %115 = OpVariable %49 Function
+ %116 = OpVariable %7 Function
+ %113 = OpAccessChain %57 %56 %22 %38
+ %114 = OpLoad %8 %113
+ OpStore %112 %114
+ %117 = OpAccessChain %23 %21 %22 %38
+ %118 = OpLoad %6 %117
+ OpStore %116 %118
+ %119 = OpFunctionCall %8 %11 %116
+ OpStore %115 %119
+ %123 = OpLoad %8 %115
+ %124 = OpConvertSToF %6 %123
+ %125 = OpLoad %8 %112
+ %126 = OpConvertSToF %6 %125
+ %127 = OpLoad %8 %112
+ %128 = OpConvertSToF %6 %127
+ %129 = OpLoad %8 %115
+ %130 = OpConvertSToF %6 %129
+ %131 = OpCompositeConstruct %120 %124 %126 %128 %130
+ OpStore %122 %131
+ OpReturn
+ OpFunctionEnd
+ %11 = OpFunction %8 None %9
+ %10 = OpFunctionParameter %7
+ %12 = OpLabel
+ %15 = OpVariable %14 Function
+ %50 = OpVariable %49 Function
+ %51 = OpVariable %49 Function
+ %70 = OpVariable %49 Function
+ %24 = OpAccessChain %23 %21 %22 %22
+ %25 = OpLoad %6 %24
+ %26 = OpCompositeConstruct %13 %25 %25
+ OpStore %15 %26
+ OpBranch %27
+ %27 = OpLabel
+ OpLoopMerge %29 %30 None
+ OpBranch %31
+ %31 = OpLabel
+ %36 = OpAccessChain %35 %34 %22
+ %37 = OpLoad %8 %36
+ %40 = OpSGreaterThanEqual %39 %37 %38
+ OpBranchConditional %40 %28 %29
+ %28 = OpLabel
+ %42 = OpAccessChain %7 %15 %41
+ %43 = OpLoad %6 %42
+ %44 = OpAccessChain %23 %21 %22 %38
+ %45 = OpLoad %6 %44
+ %46 = OpFOrdGreaterThan %39 %43 %45
+ OpSelectionMerge %48 None
+ OpBranchConditional %46 %47 %48
+ %47 = OpLabel
+ OpStore %50 %38
+ %58 = OpAccessChain %57 %56 %22 %38
+ %59 = OpLoad %8 %58
+ OpStore %51 %59
+ OpBranch %60
+ %60 = OpLabel
+ OpLoopMerge %62 %63 None
+ OpBranch %64
+ %64 = OpLabel
+ %65 = OpLoad %8 %51
+ %67 = OpAccessChain %57 %56 %22 %66
+ %68 = OpLoad %8 %67
+ %69 = OpSLessThan %39 %65 %68
+ OpBranchConditional %69 %61 %62
+ %61 = OpLabel
+ %71 = OpAccessChain %57 %56 %22 %22
+ %72 = OpLoad %8 %71
+ OpStore %70 %72
+ OpBranch %73
+ %73 = OpLabel
+ OpLoopMerge %75 %76 None
+ OpBranch %77
+ %77 = OpLabel
+ %78 = OpLoad %8 %70
+ %79 = OpAccessChain %57 %56 %22 %22
+ %80 = OpLoad %8 %79
+ %81 = OpAccessChain %35 %34 %22
+ %82 = OpLoad %8 %81
+ %83 = OpBitwiseXor %8 %80 %82
+ %84 = OpINotEqual %39 %78 %83
+ OpBranchConditional %84 %74 %75
+ %74 = OpLabel
+ OpBranch %85
+ %85 = OpLabel
+ OpLoopMerge %87 %88 None
+ OpBranch %89
+ %89 = OpLabel
+ %90 = OpLoad %8 %50
+ %91 = OpSGreaterThanEqual %39 %90 %22
+ OpBranchConditional %91 %86 %87
+ %86 = OpLabel
+ %92 = OpAccessChain %23 %21 %22 %22
+ %93 = OpLoad %6 %92
+ OpStore %10 %93
+ %94 = OpLoad %8 %50
+ %95 = OpISub %8 %94 %38
+ OpStore %50 %95
+ OpBranch %88
+ %88 = OpLabel
+ OpBranch %85
+ %87 = OpLabel
+ OpBranch %76
+ %76 = OpLabel
+ %96 = OpLoad %8 %70
+ %97 = OpISub %8 %96 %38
+ OpStore %70 %97
+ OpBranch %73
+ %75 = OpLabel
+ OpBranch %63
+ %63 = OpLabel
+ %98 = OpLoad %8 %51
+ %99 = OpIAdd %8 %98 %38
+ OpStore %51 %99
+ OpBranch %60
+ %62 = OpLabel
+ %100 = OpLoad %8 %50
+ %102 = OpIEqual %39 %100 %101
+ OpSelectionMerge %104 None
+ OpBranchConditional %102 %103 %104
+ %103 = OpLabel
+ OpReturnValue %38
+ %104 = OpLabel
+ %106 = OpLoad %6 %10
+ %107 = OpCompositeConstruct %13 %106 %106
+ OpStore %15 %107
+ OpBranch %48
+ %48 = OpLabel
+ OpBranch %30
+ %30 = OpLabel
+ OpBranch %27
+ %29 = OpLabel
+ %108 = OpAccessChain %57 %56 %22 %38
+ %109 = OpLoad %8 %108
+ OpReturnValue %109
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# one
+BUFFER variant_one DATA_TYPE int32 STD140 DATA
+ 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant_one AS push_constant
+ BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '--copy-propagate-arrays'
+# '--eliminate-local-multi-store'
+# '--if-conversion'
+# '--eliminate-local-single-block'
+# '--eliminate-dead-inserts'
+# '--redundancy-elimination'
+# '--eliminate-local-single-store'
+# '--eliminate-dead-code-aggressive'
+# '--eliminate-dead-code-aggressive'
+# '--redundancy-elimination'
+# '--scalar-replacement=100'
+# '--eliminate-local-multi-store'
+# '--inline-entry-points-exhaustive'
+# '--eliminate-dead-branches'
+# '--merge-return'
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# '--ccp'
+# '--copy-propagate-arrays'
+# '--combine-access-chains'
+# '--if-conversion'
+# '--private-to-local'
+# '--reduce-load-size'
+# '--scalar-replacement=100'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+#
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# const int _GLF_global_loop_bound = 10;
+# int _GLF_global_loop_count = 0;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# int arr0[10] = int[10](1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
+#
+# int func()
+# {
+# int a = _int_1;
+# int b = _int_0;
+# int arr1[10] = int[10](_int_1, _int_1, _int_1, _int_1, _int_1, _int_1, _int_1, _int_1, _int_1, _int_1);
+#
+# // Iterates ten times.
+# while(b >= _int_0 && _GLF_global_loop_count < _GLF_global_loop_bound)
+# {
+# _GLF_global_loop_count++;
+#
+# // Reads zero as an index and then decrements b to -1. Reads value one, so a stays at one.
+# a = arr1[b--];
+#
+# // arr0[1] = arr0[0]. No effect.
+# arr0[_int_1] = arr0[a];
+#
+# // Always true.
+# if(a > _int_0)
+# {
+# // Increments b to zero and indexes with that. Writes one to arr1[0] but that value already existed.
+# arr1[++b] = a;
+# }
+# }
+#
+# // Returns zero.
+# return b;
+# }
+#
+# void main()
+# {
+# // Always true.
+# if(func() == _int_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 157
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %104
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "func("
+ OpName %11 "_GLF_global_loop_count"
+ OpName %17 "arr0"
+ OpName %24 "buf0"
+ OpMemberName %24 0 "_GLF_uniform_int_values"
+ OpName %26 ""
+ OpName %34 "arr1"
+ OpName %104 "_GLF_color"
+ OpDecorate %23 ArrayStride 16
+ OpMemberDecorate %24 0 Offset 0
+ OpDecorate %24 Block
+ OpDecorate %26 DescriptorSet 0
+ OpDecorate %26 Binding 0
+ OpDecorate %104 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypeFunction %6
+ %10 = OpTypePointer Private %6
+ %11 = OpVariable %10 Private
+ %12 = OpConstant %6 0
+ %13 = OpTypeInt 32 0
+ %14 = OpConstant %13 10
+ %15 = OpTypeArray %6 %14
+ %16 = OpTypePointer Private %15
+ %17 = OpVariable %16 Private
+ %18 = OpConstant %6 1
+ %19 = OpConstantComposite %15 %18 %18 %18 %18 %18 %18 %18 %18 %18 %18
+ %20 = OpTypePointer Function %6
+ %22 = OpConstant %13 2
+ %23 = OpTypeArray %6 %22
+ %24 = OpTypeStruct %23
+ %25 = OpTypePointer Uniform %24
+ %26 = OpVariable %25 Uniform
+ %27 = OpTypePointer Uniform %6
+ %33 = OpTypePointer Function %15
+ %64 = OpTypeBool
+ %67 = OpConstant %6 10
+ %101 = OpTypeFloat 32
+ %102 = OpTypeVector %101 4
+ %103 = OpTypePointer Output %102
+ %104 = OpVariable %103 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %125 = OpVariable %33 Function
+ %126 = OpVariable %20 Function
+ OpStore %11 %12
+ OpStore %17 %19
+ %128 = OpAccessChain %27 %26 %12 %12
+ %129 = OpLoad %6 %128
+ %130 = OpAccessChain %27 %26 %12 %18
+ %131 = OpLoad %6 %130
+ %132 = OpCompositeConstruct %15 %129 %129 %129 %129 %129 %129 %129 %129 %129 %129
+ OpStore %125 %132
+ OpBranch %133
+ %133 = OpLabel
+ %134 = OpPhi %6 %131 %5 %154 %155
+ %136 = OpSGreaterThanEqual %64 %134 %131
+ %137 = OpLoad %6 %11
+ %138 = OpSLessThan %64 %137 %67
+ %139 = OpLogicalAnd %64 %136 %138
+ OpLoopMerge %156 %155 None
+ OpBranchConditional %139 %140 %156
+ %140 = OpLabel
+ %141 = OpLoad %6 %11
+ %142 = OpIAdd %6 %141 %18
+ OpStore %11 %142
+ %143 = OpISub %6 %134 %18
+ %144 = OpAccessChain %20 %125 %134
+ %145 = OpLoad %6 %144
+ %146 = OpAccessChain %10 %17 %145
+ %147 = OpLoad %6 %146
+ %148 = OpAccessChain %10 %17 %129
+ OpStore %148 %147
+ %149 = OpSGreaterThan %64 %145 %131
+ OpSelectionMerge %153 None
+ OpBranchConditional %149 %150 %153
+ %150 = OpLabel
+ %151 = OpIAdd %6 %143 %18
+ %152 = OpAccessChain %20 %125 %151
+ OpStore %152 %145
+ OpBranch %153
+ %153 = OpLabel
+ %154 = OpPhi %6 %143 %140 %151 %150
+ OpBranch %155
+ %155 = OpLabel
+ OpBranch %133
+ %156 = OpLabel
+ OpStore %126 %134
+ %95 = OpLoad %6 %126
+ %96 = OpAccessChain %27 %26 %12 %18
+ %97 = OpLoad %6 %96
+ %98 = OpIEqual %64 %95 %97
+ OpSelectionMerge %100 None
+ OpBranchConditional %98 %99 %118
+ %99 = OpLabel
+ %105 = OpAccessChain %27 %26 %12 %12
+ %106 = OpLoad %6 %105
+ %107 = OpConvertSToF %101 %106
+ %110 = OpConvertSToF %101 %97
+ %117 = OpCompositeConstruct %102 %107 %110 %110 %107
+ OpStore %104 %117
+ OpBranch %100
+ %118 = OpLabel
+ %121 = OpConvertSToF %101 %97
+ %122 = OpCompositeConstruct %102 %121 %121 %121 %121
+ OpStore %104 %122
+ OpBranch %100
+ %100 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %8 = OpFunction %6 None %7
+ %9 = OpLabel
+ %34 = OpVariable %33 Function
+ %28 = OpAccessChain %27 %26 %12 %12
+ %29 = OpLoad %6 %28
+ %31 = OpAccessChain %27 %26 %12 %18
+ %32 = OpLoad %6 %31
+ %55 = OpCompositeConstruct %15 %29 %29 %29 %29 %29 %29 %29 %29 %29 %29
+ OpStore %34 %55
+ OpBranch %56
+ %56 = OpLabel
+ %123 = OpPhi %6 %32 %9 %124 %59
+ OpLoopMerge %58 %59 None
+ OpBranch %60
+ %60 = OpLabel
+ %65 = OpSGreaterThanEqual %64 %123 %32
+ %66 = OpLoad %6 %11
+ %68 = OpSLessThan %64 %66 %67
+ %69 = OpLogicalAnd %64 %65 %68
+ OpBranchConditional %69 %57 %58
+ %57 = OpLabel
+ %70 = OpLoad %6 %11
+ %71 = OpIAdd %6 %70 %18
+ OpStore %11 %71
+ %73 = OpISub %6 %123 %18
+ %74 = OpAccessChain %20 %34 %123
+ %75 = OpLoad %6 %74
+ %79 = OpAccessChain %10 %17 %75
+ %80 = OpLoad %6 %79
+ %81 = OpAccessChain %10 %17 %29
+ OpStore %81 %80
+ %85 = OpSGreaterThan %64 %75 %32
+ OpSelectionMerge %87 None
+ OpBranchConditional %85 %86 %87
+ %86 = OpLabel
+ %89 = OpIAdd %6 %73 %18
+ %91 = OpAccessChain %20 %34 %89
+ OpStore %91 %75
+ OpBranch %87
+ %87 = OpLabel
+ %124 = OpPhi %6 %73 %57 %89 %86
+ OpBranch %59
+ %59 = OpLabel
+ OpBranch %56
+ %58 = OpLabel
+ OpReturnValue %123
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_5 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [5, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# for(int i = _int_0; i < _int_5; i++)
+# {
+# if(i != 1)
+# {
+# if(i != 2)
+# {
+# // Always false.
+# if(gl_FragCoord.x < 0.0)
+# {
+# discard;
+# }
+# else
+# {
+# _GLF_color = vec4(1, 0, 0, 1);
+# }
+# }
+# }
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 59
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %42 %54
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "i"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %42 "gl_FragCoord"
+ OpName %54 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %42 BuiltIn FragCoord
+ OpDecorate %54 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 2
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpConstant %6 1
+ %17 = OpTypePointer Uniform %6
+ %28 = OpTypeBool
+ %35 = OpConstant %6 2
+ %39 = OpTypeFloat 32
+ %40 = OpTypeVector %39 4
+ %41 = OpTypePointer Input %40
+ %42 = OpVariable %41 Input
+ %43 = OpConstant %9 0
+ %44 = OpTypePointer Input %39
+ %47 = OpConstant %39 0
+ %53 = OpTypePointer Output %40
+ %54 = OpVariable %53 Output
+ %55 = OpConstant %39 1
+ %56 = OpConstantComposite %40 %55 %47 %47 %55
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ OpBranch %20
+ %20 = OpLabel
+ OpLoopMerge %22 %23 None
+ OpBranch %24
+ %24 = OpLabel
+ %25 = OpLoad %6 %8
+ %26 = OpAccessChain %17 %14 %15 %15
+ %27 = OpLoad %6 %26
+ %29 = OpSLessThan %28 %25 %27
+ OpBranchConditional %29 %21 %22
+ %21 = OpLabel
+ %30 = OpLoad %6 %8
+ %31 = OpINotEqual %28 %30 %16
+ OpSelectionMerge %33 None
+ OpBranchConditional %31 %32 %33
+ %32 = OpLabel
+ %34 = OpLoad %6 %8
+ %36 = OpINotEqual %28 %34 %35
+ OpSelectionMerge %38 None
+ OpBranchConditional %36 %37 %38
+ %37 = OpLabel
+ %45 = OpAccessChain %44 %42 %43
+ %46 = OpLoad %39 %45
+ %48 = OpFOrdLessThan %28 %46 %47
+ OpSelectionMerge %50 None
+ OpBranchConditional %48 %49 %52
+ %49 = OpLabel
+ OpKill
+ %52 = OpLabel
+ OpStore %54 %56
+ OpBranch %50
+ %50 = OpLabel
+ OpBranch %38
+ %38 = OpLabel
+ OpBranch %33
+ %33 = OpLabel
+ OpBranch %23
+ %23 = OpLabel
+ %57 = OpLoad %6 %8
+ %58 = OpIAdd %6 %57 %16
+ OpStore %8 %58
+ OpBranch %20
+ %22 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 5 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+#
+# #define _GLF_MAKE_IN_BOUNDS_INT(IDX, SZ) clamp(IDX, 0, SZ - 1)
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_3 _GLF_uniform_int_values[3]
+# #define _int_4 _GLF_uniform_int_values[4]
+# #define _int_5 _GLF_uniform_int_values[5]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 2, 3, 4, 5]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[6];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int arr[5] = int[5](_int_0, _int_1, _int_2, _int_3, _int_4);
+# int ref[5] = int[5](_int_0, _int_1, _int_2, _int_1, _int_1);
+#
+# // Copies arr[1] to indices 1, 3, and 4.
+# for(int i = 0; i < 5; i++)
+# {
+# // Always true.
+# if(_int_0 < _int_1)
+# {
+# i++;
+# }
+# arr[_GLF_MAKE_IN_BOUNDS_INT(i, 5)] = arr[_int_1];
+# }
+#
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# // Verify results and set color to black if failed.
+# for(int i = _int_0; i < _int_5; i++)
+# {
+# if(arr[i] != ref[i])
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 119
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %78
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %11 "arr"
+ OpName %14 "buf0"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpName %34 "ref"
+ OpName %47 "i"
+ OpName %78 "_GLF_color"
+ OpName %92 "i"
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 0
+ OpDecorate %78 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypeInt 32 0
+ %8 = OpConstant %7 5
+ %9 = OpTypeArray %6 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpConstant %7 6
+ %13 = OpTypeArray %6 %12
+ %14 = OpTypeStruct %13
+ %15 = OpTypePointer Uniform %14
+ %16 = OpVariable %15 Uniform
+ %17 = OpConstant %6 0
+ %18 = OpTypePointer Uniform %6
+ %21 = OpConstant %6 1
+ %24 = OpConstant %6 2
+ %27 = OpConstant %6 3
+ %30 = OpConstant %6 4
+ %46 = OpTypePointer Function %6
+ %54 = OpConstant %6 5
+ %55 = OpTypeBool
+ %75 = OpTypeFloat 32
+ %76 = OpTypeVector %75 4
+ %77 = OpTypePointer Output %76
+ %78 = OpVariable %77 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %34 = OpVariable %10 Function
+ %47 = OpVariable %46 Function
+ %92 = OpVariable %46 Function
+ %19 = OpAccessChain %18 %16 %17 %17
+ %20 = OpLoad %6 %19
+ %22 = OpAccessChain %18 %16 %17 %21
+ %23 = OpLoad %6 %22
+ %25 = OpAccessChain %18 %16 %17 %24
+ %26 = OpLoad %6 %25
+ %28 = OpAccessChain %18 %16 %17 %27
+ %29 = OpLoad %6 %28
+ %31 = OpAccessChain %18 %16 %17 %30
+ %32 = OpLoad %6 %31
+ %33 = OpCompositeConstruct %9 %20 %23 %26 %29 %32
+ OpStore %11 %33
+ %35 = OpAccessChain %18 %16 %17 %17
+ %36 = OpLoad %6 %35
+ %37 = OpAccessChain %18 %16 %17 %21
+ %38 = OpLoad %6 %37
+ %39 = OpAccessChain %18 %16 %17 %24
+ %40 = OpLoad %6 %39
+ %41 = OpAccessChain %18 %16 %17 %21
+ %42 = OpLoad %6 %41
+ %43 = OpAccessChain %18 %16 %17 %21
+ %44 = OpLoad %6 %43
+ %45 = OpCompositeConstruct %9 %36 %38 %40 %42 %44
+ OpStore %34 %45
+ OpStore %47 %17
+ OpBranch %48
+ %48 = OpLabel
+ OpLoopMerge %50 %51 None
+ OpBranch %52
+ %52 = OpLabel
+ %53 = OpLoad %6 %47
+ %56 = OpSLessThan %55 %53 %54
+ OpBranchConditional %56 %49 %50
+ %49 = OpLabel
+ %57 = OpAccessChain %18 %16 %17 %17
+ %58 = OpLoad %6 %57
+ %59 = OpAccessChain %18 %16 %17 %21
+ %60 = OpLoad %6 %59
+ %61 = OpSLessThan %55 %58 %60
+ OpSelectionMerge %63 None
+ OpBranchConditional %61 %62 %63
+ %62 = OpLabel
+ %64 = OpLoad %6 %47
+ %65 = OpIAdd %6 %64 %21
+ OpStore %47 %65
+ OpBranch %63
+ %63 = OpLabel
+ %66 = OpLoad %6 %47
+ %67 = OpExtInst %6 %1 SClamp %66 %17 %30
+ %68 = OpAccessChain %18 %16 %17 %21
+ %69 = OpLoad %6 %68
+ %70 = OpAccessChain %46 %11 %69
+ %71 = OpLoad %6 %70
+ %72 = OpAccessChain %46 %11 %67
+ OpStore %72 %71
+ OpBranch %51
+ %51 = OpLabel
+ %73 = OpLoad %6 %47
+ %74 = OpIAdd %6 %73 %21
+ OpStore %47 %74
+ OpBranch %48
+ %50 = OpLabel
+ %79 = OpAccessChain %18 %16 %17 %21
+ %80 = OpLoad %6 %79
+ %81 = OpConvertSToF %75 %80
+ %82 = OpAccessChain %18 %16 %17 %17
+ %83 = OpLoad %6 %82
+ %84 = OpConvertSToF %75 %83
+ %85 = OpAccessChain %18 %16 %17 %17
+ %86 = OpLoad %6 %85
+ %87 = OpConvertSToF %75 %86
+ %88 = OpAccessChain %18 %16 %17 %21
+ %89 = OpLoad %6 %88
+ %90 = OpConvertSToF %75 %89
+ %91 = OpCompositeConstruct %76 %81 %84 %87 %90
+ OpStore %78 %91
+ %93 = OpAccessChain %18 %16 %17 %17
+ %94 = OpLoad %6 %93
+ OpStore %92 %94
+ OpBranch %95
+ %95 = OpLabel
+ OpLoopMerge %97 %98 None
+ OpBranch %99
+ %99 = OpLabel
+ %100 = OpLoad %6 %92
+ %101 = OpAccessChain %18 %16 %17 %54
+ %102 = OpLoad %6 %101
+ %103 = OpSLessThan %55 %100 %102
+ OpBranchConditional %103 %96 %97
+ %96 = OpLabel
+ %104 = OpLoad %6 %92
+ %105 = OpAccessChain %46 %11 %104
+ %106 = OpLoad %6 %105
+ %107 = OpLoad %6 %92
+ %108 = OpAccessChain %46 %34 %107
+ %109 = OpLoad %6 %108
+ %110 = OpINotEqual %55 %106 %109
+ OpSelectionMerge %112 None
+ OpBranchConditional %110 %111 %112
+ %111 = OpLabel
+ %113 = OpAccessChain %18 %16 %17 %17
+ %114 = OpLoad %6 %113
+ %115 = OpConvertSToF %75 %114
+ %116 = OpCompositeConstruct %76 %115 %115 %115 %115
+ OpStore %78 %116
+ OpBranch %112
+ %112 = OpLabel
+ OpBranch %98
+ %98 = OpLabel
+ %117 = OpLoad %6 %92
+ %118 = OpIAdd %6 %117 %21
+ OpStore %92 %118
+ OpBranch %95
+ %97 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 2 3 4 5
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_9 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #define _int_3 _GLF_uniform_int_values[4]
+# #define _int_4 _GLF_uniform_int_values[5]
+# #define _int_5 _GLF_uniform_int_values[6]
+# #define _int_6 _GLF_uniform_int_values[7]
+# #define _int_7 _GLF_uniform_int_values[8]
+# #define _int_8 _GLF_uniform_int_values[9]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [9, 0, 2, 1, 3, 4, 5, 6, 7, 8]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[10];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int a = _int_0;
+# int arr[10] = int[10](_int_0, _int_1, _int_2, _int_3, _int_4, _int_5, _int_6, _int_7, _int_8, _int_9);
+#
+# for(int i = _int_0; i < _int_9; i++)
+# {
+# a++;
+# // a equals i + 1.
+# arr[_int_2] = arr[a];
+# }
+#
+# // Always true.
+# if(arr[_int_2] == _int_9)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 105
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %86
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %21 "arr"
+ OpName %51 "i"
+ OpName %86 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %86 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 10
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpConstant %6 1
+ %17 = OpTypePointer Uniform %6
+ %20 = OpTypePointer Function %11
+ %24 = OpConstant %6 3
+ %27 = OpConstant %6 2
+ %30 = OpConstant %6 4
+ %33 = OpConstant %6 5
+ %36 = OpConstant %6 6
+ %39 = OpConstant %6 7
+ %42 = OpConstant %6 8
+ %45 = OpConstant %6 9
+ %62 = OpTypeBool
+ %83 = OpTypeFloat 32
+ %84 = OpTypeVector %83 4
+ %85 = OpTypePointer Output %84
+ %86 = OpVariable %85 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %21 = OpVariable %20 Function
+ %51 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ %22 = OpAccessChain %17 %14 %15 %16
+ %23 = OpLoad %6 %22
+ %25 = OpAccessChain %17 %14 %15 %24
+ %26 = OpLoad %6 %25
+ %28 = OpAccessChain %17 %14 %15 %27
+ %29 = OpLoad %6 %28
+ %31 = OpAccessChain %17 %14 %15 %30
+ %32 = OpLoad %6 %31
+ %34 = OpAccessChain %17 %14 %15 %33
+ %35 = OpLoad %6 %34
+ %37 = OpAccessChain %17 %14 %15 %36
+ %38 = OpLoad %6 %37
+ %40 = OpAccessChain %17 %14 %15 %39
+ %41 = OpLoad %6 %40
+ %43 = OpAccessChain %17 %14 %15 %42
+ %44 = OpLoad %6 %43
+ %46 = OpAccessChain %17 %14 %15 %45
+ %47 = OpLoad %6 %46
+ %48 = OpAccessChain %17 %14 %15 %15
+ %49 = OpLoad %6 %48
+ %50 = OpCompositeConstruct %11 %23 %26 %29 %32 %35 %38 %41 %44 %47 %49
+ OpStore %21 %50
+ %52 = OpAccessChain %17 %14 %15 %16
+ %53 = OpLoad %6 %52
+ OpStore %51 %53
+ OpBranch %54
+ %54 = OpLabel
+ OpLoopMerge %56 %57 None
+ OpBranch %58
+ %58 = OpLabel
+ %59 = OpLoad %6 %51
+ %60 = OpAccessChain %17 %14 %15 %15
+ %61 = OpLoad %6 %60
+ %63 = OpSLessThan %62 %59 %61
+ OpBranchConditional %63 %55 %56
+ %55 = OpLabel
+ %64 = OpLoad %6 %8
+ %65 = OpIAdd %6 %64 %16
+ OpStore %8 %65
+ %66 = OpAccessChain %17 %14 %15 %27
+ %67 = OpLoad %6 %66
+ %68 = OpLoad %6 %8
+ %69 = OpAccessChain %7 %21 %68
+ %70 = OpLoad %6 %69
+ %71 = OpAccessChain %7 %21 %67
+ OpStore %71 %70
+ OpBranch %57
+ %57 = OpLabel
+ %72 = OpLoad %6 %51
+ %73 = OpIAdd %6 %72 %16
+ OpStore %51 %73
+ OpBranch %54
+ %56 = OpLabel
+ %74 = OpAccessChain %17 %14 %15 %27
+ %75 = OpLoad %6 %74
+ %76 = OpAccessChain %7 %21 %75
+ %77 = OpLoad %6 %76
+ %78 = OpAccessChain %17 %14 %15 %15
+ %79 = OpLoad %6 %78
+ %80 = OpIEqual %62 %77 %79
+ OpSelectionMerge %82 None
+ OpBranchConditional %80 %81 %100
+ %81 = OpLabel
+ %87 = OpAccessChain %17 %14 %15 %24
+ %88 = OpLoad %6 %87
+ %89 = OpConvertSToF %83 %88
+ %90 = OpAccessChain %17 %14 %15 %16
+ %91 = OpLoad %6 %90
+ %92 = OpConvertSToF %83 %91
+ %93 = OpAccessChain %17 %14 %15 %16
+ %94 = OpLoad %6 %93
+ %95 = OpConvertSToF %83 %94
+ %96 = OpAccessChain %17 %14 %15 %24
+ %97 = OpLoad %6 %96
+ %98 = OpConvertSToF %83 %97
+ %99 = OpCompositeConstruct %84 %89 %92 %95 %98
+ OpStore %86 %99
+ OpBranch %82
+ %100 = OpLabel
+ %101 = OpAccessChain %17 %14 %15 %16
+ %102 = OpLoad %6 %101
+ %103 = OpConvertSToF %83 %102
+ %104 = OpCompositeConstruct %84 %103 %103 %103 %103
+ OpStore %86 %104
+ OpBranch %82
+ %82 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 9 0 2 1 3 4 5 6 7 8
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_10 _GLF_uniform_int_values[2]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int a = _int_0;
+#
+# // Iterates once: min(2, findMSB(1)) = min(2, 0) = 0.
+# for(int i = 0; i <= min(2, findMSB(1)) && a < _int_10; i++)
+# {
+# a++;
+# }
+#
+# // Always true.
+# if(a == _int_1)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 71
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %52
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %20 "i"
+ OpName %52 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %30 RelaxedPrecision
+ OpDecorate %52 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 3
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpConstant %6 1
+ %17 = OpTypePointer Uniform %6
+ %26 = OpTypeBool
+ %28 = OpConstant %6 2
+ %49 = OpTypeFloat 32
+ %50 = OpTypeVector %49 4
+ %51 = OpTypePointer Output %50
+ %52 = OpVariable %51 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %20 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ OpStore %20 %15
+ OpBranch %21
+ %21 = OpLabel
+ OpLoopMerge %23 %24 None
+ OpBranch %25
+ %25 = OpLabel
+ %27 = OpLoad %6 %20
+ %29 = OpExtInst %6 %1 FindSMsb %16
+ %30 = OpExtInst %6 %1 SMin %28 %29
+ %31 = OpSLessThanEqual %26 %27 %30
+ OpSelectionMerge %33 None
+ OpBranchConditional %31 %32 %33
+ %32 = OpLabel
+ %34 = OpLoad %6 %8
+ %35 = OpAccessChain %17 %14 %15 %28
+ %36 = OpLoad %6 %35
+ %37 = OpSLessThan %26 %34 %36
+ OpBranch %33
+ %33 = OpLabel
+ %38 = OpPhi %26 %31 %25 %37 %32
+ OpBranchConditional %38 %22 %23
+ %22 = OpLabel
+ %39 = OpLoad %6 %8
+ %40 = OpIAdd %6 %39 %16
+ OpStore %8 %40
+ OpBranch %24
+ %24 = OpLabel
+ %41 = OpLoad %6 %20
+ %42 = OpIAdd %6 %41 %16
+ OpStore %20 %42
+ OpBranch %21
+ %23 = OpLabel
+ %43 = OpLoad %6 %8
+ %44 = OpAccessChain %17 %14 %15 %15
+ %45 = OpLoad %6 %44
+ %46 = OpIEqual %26 %43 %45
+ OpSelectionMerge %48 None
+ OpBranchConditional %46 %47 %66
+ %47 = OpLabel
+ %53 = OpAccessChain %17 %14 %15 %15
+ %54 = OpLoad %6 %53
+ %55 = OpConvertSToF %49 %54
+ %56 = OpAccessChain %17 %14 %15 %16
+ %57 = OpLoad %6 %56
+ %58 = OpConvertSToF %49 %57
+ %59 = OpAccessChain %17 %14 %15 %16
+ %60 = OpLoad %6 %59
+ %61 = OpConvertSToF %49 %60
+ %62 = OpAccessChain %17 %14 %15 %15
+ %63 = OpLoad %6 %62
+ %64 = OpConvertSToF %49 %63
+ %65 = OpCompositeConstruct %50 %55 %58 %61 %64
+ OpStore %52 %65
+ OpBranch %48
+ %66 = OpLabel
+ %67 = OpAccessChain %17 %14 %15 %16
+ %68 = OpLoad %6 %67
+ %69 = OpConvertSToF %49 %68
+ %70 = OpCompositeConstruct %50 %69 %69 %69 %69
+ OpStore %52 %70
+ OpBranch %48
+ %48 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 10
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '-O'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# _GLF_color = vec4(0);
+#
+# // Iterates once.
+# for(int i = _int_1 & 1; i > 0; i--)
+# {
+# while(true)
+# {
+# _GLF_color = vec4(i, _int_0, _int_0, i);
+#
+# // Always true.
+# if(_int_1 > 0)
+# {
+# break;
+# }
+# }
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 61
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %9 "_GLF_color"
+ OpName %18 "buf0"
+ OpMemberName %18 0 "_GLF_uniform_int_values"
+ OpName %20 ""
+ OpDecorate %9 Location 0
+ OpDecorate %17 ArrayStride 16
+ OpMemberDecorate %18 0 Offset 0
+ OpDecorate %18 Block
+ OpDecorate %20 DescriptorSet 0
+ OpDecorate %20 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypePointer Output %7
+ %9 = OpVariable %8 Output
+ %10 = OpConstant %6 0
+ %11 = OpConstantComposite %7 %10 %10 %10 %10
+ %12 = OpTypeInt 32 1
+ %15 = OpTypeInt 32 0
+ %16 = OpConstant %15 2
+ %17 = OpTypeArray %12 %16
+ %18 = OpTypeStruct %17
+ %19 = OpTypePointer Uniform %18
+ %20 = OpVariable %19 Uniform
+ %21 = OpConstant %12 0
+ %22 = OpTypePointer Uniform %12
+ %25 = OpConstant %12 1
+ %33 = OpTypeBool
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ OpStore %9 %11
+ %23 = OpAccessChain %22 %20 %21 %21
+ %24 = OpLoad %12 %23
+ %26 = OpBitwiseAnd %12 %24 %25
+ OpBranch %27
+ %27 = OpLabel
+ %60 = OpPhi %12 %26 %5 %59 %30
+ %34 = OpSGreaterThan %33 %60 %21
+ OpLoopMerge %29 %30 None
+ OpBranchConditional %34 %28 %29
+ %28 = OpLabel
+ OpBranch %35
+ %35 = OpLabel
+ OpLoopMerge %55 %38 None
+ OpBranch %36
+ %36 = OpLabel
+ %42 = OpConvertSToF %6 %60
+ %43 = OpAccessChain %22 %20 %21 %25
+ %44 = OpLoad %12 %43
+ %45 = OpConvertSToF %6 %44
+ %51 = OpCompositeConstruct %7 %42 %45 %45 %42
+ OpStore %9 %51
+ %54 = OpSGreaterThan %33 %24 %21
+ OpSelectionMerge %56 None
+ OpBranchConditional %54 %55 %56
+ %55 = OpLabel
+ OpBranch %30
+ %56 = OpLabel
+ OpBranch %38
+ %38 = OpLabel
+ OpBranch %35
+ %30 = OpLabel
+ %59 = OpISub %12 %60 %25
+ OpBranch %27
+ %29 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of zero: 0
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int zero;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, 1);
+# int a = 1;
+#
+# // Iterates until a reaches seven.
+# do
+# {
+# if(a++ >= 7)
+# {
+# break;
+# }
+#
+# // v = (1, 0, 0, 1)
+# vec4 v = _GLF_color;
+#
+# // The original value is always restored below.
+# _GLF_color = vec4(a);
+#
+# // Always true.
+# if(gl_FragCoord.x >= 0.0)
+# {
+# _GLF_color = v;
+# }
+# }
+# while(_int_1 > zero);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 70
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9 %52
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %9 "_GLF_color"
+ OpName %14 "buf0"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpName %32 "a"
+ OpName %46 "v"
+ OpName %52 "gl_FragCoord"
+ OpName %64 "buf1"
+ OpMemberName %64 0 "zero"
+ OpName %66 ""
+ OpDecorate %9 Location 0
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 0
+ OpDecorate %52 BuiltIn FragCoord
+ OpMemberDecorate %64 0 Offset 0
+ OpDecorate %64 Block
+ OpDecorate %66 DescriptorSet 0
+ OpDecorate %66 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypePointer Output %7
+ %9 = OpVariable %8 Output
+ %10 = OpTypeInt 32 1
+ %11 = OpTypeInt 32 0
+ %12 = OpConstant %11 2
+ %13 = OpTypeArray %10 %12
+ %14 = OpTypeStruct %13
+ %15 = OpTypePointer Uniform %14
+ %16 = OpVariable %15 Uniform
+ %17 = OpConstant %10 0
+ %18 = OpTypePointer Uniform %10
+ %22 = OpConstant %10 1
+ %29 = OpConstant %6 1
+ %31 = OpTypePointer Function %10
+ %39 = OpConstant %10 7
+ %40 = OpTypeBool
+ %45 = OpTypePointer Function %7
+ %51 = OpTypePointer Input %7
+ %52 = OpVariable %51 Input
+ %53 = OpConstant %11 0
+ %54 = OpTypePointer Input %6
+ %57 = OpConstant %6 0
+ %64 = OpTypeStruct %10
+ %65 = OpTypePointer Uniform %64
+ %66 = OpVariable %65 Uniform
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %32 = OpVariable %31 Function
+ %46 = OpVariable %45 Function
+ %19 = OpAccessChain %18 %16 %17 %17
+ %20 = OpLoad %10 %19
+ %21 = OpConvertSToF %6 %20
+ %23 = OpAccessChain %18 %16 %17 %22
+ %24 = OpLoad %10 %23
+ %25 = OpConvertSToF %6 %24
+ %26 = OpAccessChain %18 %16 %17 %22
+ %27 = OpLoad %10 %26
+ %28 = OpConvertSToF %6 %27
+ %30 = OpCompositeConstruct %7 %21 %25 %28 %29
+ OpStore %9 %30
+ OpStore %32 %22
+ OpBranch %33
+ %33 = OpLabel
+ OpLoopMerge %35 %36 None
+ OpBranch %34
+ %34 = OpLabel
+ %37 = OpLoad %10 %32
+ %38 = OpIAdd %10 %37 %22
+ OpStore %32 %38
+ %41 = OpSGreaterThanEqual %40 %37 %39
+ OpSelectionMerge %43 None
+ OpBranchConditional %41 %42 %43
+ %42 = OpLabel
+ OpBranch %35
+ %43 = OpLabel
+ %47 = OpLoad %7 %9
+ OpStore %46 %47
+ %48 = OpLoad %10 %32
+ %49 = OpConvertSToF %6 %48
+ %50 = OpCompositeConstruct %7 %49 %49 %49 %49
+ OpStore %9 %50
+ %55 = OpAccessChain %54 %52 %53
+ %56 = OpLoad %6 %55
+ %58 = OpFOrdGreaterThanEqual %40 %56 %57
+ OpSelectionMerge %60 None
+ OpBranchConditional %58 %59 %60
+ %59 = OpLabel
+ %61 = OpLoad %7 %46
+ OpStore %9 %61
+ OpBranch %60
+ %60 = OpLabel
+ OpBranch %36
+ %36 = OpLabel
+ %62 = OpAccessChain %18 %16 %17 %17
+ %63 = OpLoad %10 %62
+ %67 = OpAccessChain %18 %66 %17
+ %68 = OpLoad %10 %67
+ %69 = OpSGreaterThan %40 %63 %68
+ OpBranchConditional %69 %33 %35
+ %35 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# zero
+BUFFER variant_zero DATA_TYPE int32 STD140 DATA
+ 0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant_zero AS uniform DESCRIPTOR_SET 0 BINDING 1
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_25225 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [10, 25225, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+#
+# // a becomes -25235.
+# int a = -25236 | _int_1;
+#
+# // Increments a by ten.
+# for(int i = _int_0; i < _int_10; i++)
+# {
+# a++;
+# }
+#
+# // Always true.
+# if(a == -_int_25225)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 70
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %51
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %13 "buf0"
+ OpMemberName %13 0 "_GLF_uniform_int_values"
+ OpName %15 ""
+ OpName %22 "i"
+ OpName %51 "_GLF_color"
+ OpDecorate %12 ArrayStride 16
+ OpMemberDecorate %13 0 Offset 0
+ OpDecorate %13 Block
+ OpDecorate %15 DescriptorSet 0
+ OpDecorate %15 Binding 0
+ OpDecorate %51 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 -25236
+ %10 = OpTypeInt 32 0
+ %11 = OpConstant %10 4
+ %12 = OpTypeArray %6 %11
+ %13 = OpTypeStruct %12
+ %14 = OpTypePointer Uniform %13
+ %15 = OpVariable %14 Uniform
+ %16 = OpConstant %6 0
+ %17 = OpConstant %6 3
+ %18 = OpTypePointer Uniform %6
+ %23 = OpConstant %6 2
+ %34 = OpTypeBool
+ %37 = OpConstant %6 1
+ %48 = OpTypeFloat 32
+ %49 = OpTypeVector %48 4
+ %50 = OpTypePointer Output %49
+ %51 = OpVariable %50 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %22 = OpVariable %7 Function
+ %19 = OpAccessChain %18 %15 %16 %17
+ %20 = OpLoad %6 %19
+ %21 = OpBitwiseOr %6 %9 %20
+ OpStore %8 %21
+ %24 = OpAccessChain %18 %15 %16 %23
+ %25 = OpLoad %6 %24
+ OpStore %22 %25
+ OpBranch %26
+ %26 = OpLabel
+ OpLoopMerge %28 %29 None
+ OpBranch %30
+ %30 = OpLabel
+ %31 = OpLoad %6 %22
+ %32 = OpAccessChain %18 %15 %16 %16
+ %33 = OpLoad %6 %32
+ %35 = OpSLessThan %34 %31 %33
+ OpBranchConditional %35 %27 %28
+ %27 = OpLabel
+ %36 = OpLoad %6 %8
+ %38 = OpIAdd %6 %36 %37
+ OpStore %8 %38
+ OpBranch %29
+ %29 = OpLabel
+ %39 = OpLoad %6 %22
+ %40 = OpIAdd %6 %39 %37
+ OpStore %22 %40
+ OpBranch %26
+ %28 = OpLabel
+ %41 = OpLoad %6 %8
+ %42 = OpAccessChain %18 %15 %16 %37
+ %43 = OpLoad %6 %42
+ %44 = OpSNegate %6 %43
+ %45 = OpIEqual %34 %41 %44
+ OpSelectionMerge %47 None
+ OpBranchConditional %45 %46 %65
+ %46 = OpLabel
+ %52 = OpAccessChain %18 %15 %16 %17
+ %53 = OpLoad %6 %52
+ %54 = OpConvertSToF %48 %53
+ %55 = OpAccessChain %18 %15 %16 %23
+ %56 = OpLoad %6 %55
+ %57 = OpConvertSToF %48 %56
+ %58 = OpAccessChain %18 %15 %16 %23
+ %59 = OpLoad %6 %58
+ %60 = OpConvertSToF %48 %59
+ %61 = OpAccessChain %18 %15 %16 %17
+ %62 = OpLoad %6 %61
+ %63 = OpConvertSToF %48 %62
+ %64 = OpCompositeConstruct %49 %54 %57 %60 %63
+ OpStore %51 %64
+ OpBranch %47
+ %65 = OpLabel
+ %66 = OpAccessChain %18 %15 %16 %23
+ %67 = OpLoad %6 %66
+ %68 = OpConvertSToF %48 %67
+ %69 = OpCompositeConstruct %49 %68 %68 %68 %68
+ OpStore %51 %69
+ OpBranch %47
+ %47 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 25225 0 1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+#
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_9 _GLF_uniform_int_values[1]
+# #define _int_10 _GLF_uniform_int_values[2]
+# #define _int_0 _GLF_uniform_int_values[3]
+# #define _int_2 _GLF_uniform_int_values[4]
+# #define _int_3 _GLF_uniform_int_values[5]
+# #define _int_4 _GLF_uniform_int_values[6]
+# #define _int_5 _GLF_uniform_int_values[7]
+# #define _int_6 _GLF_uniform_int_values[8]
+# #define _int_7 _GLF_uniform_int_values[9]
+# #define _int_8 _GLF_uniform_int_values[10]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: 0.0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[1];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [1, 9, 10, 0, 2, 3, 4, 5, 6, 7, 8]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[11];
+# };
+#
+# // Contents of zero: 0
+# layout(set = 0, binding = 2) uniform buf2 {
+# int zero;
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int arr[10] = int[10](_int_0, _int_1, _int_2, _int_3, _int_4, _int_5, _int_6, _int_7, _int_8, _int_9);
+# int a = _int_0;
+#
+# // Iterates two times.
+# for(int i = 1; i < _int_3; i++)
+# {
+# // Always false.
+# if(a >= _int_1)
+# {
+# break;
+# }
+#
+# // Always false.
+# if(zero < _int_0)
+# {
+# a++;
+# }
+#
+# int b = _int_1;
+#
+# // Iterates once.
+# do
+# {
+# // Iterates six times until breaks because of b >= 7.
+# for(int j = 0; j < _int_10; j++)
+# {
+# if(b >= _int_7)
+# {
+# break;
+# }
+#
+# b++;
+#
+# // True when:
+# // j == 0 && i == 1
+# // j == 1 && i == 1
+# // j == 0 && i == 2
+# // j == 1 && i == 2
+# // j == 2 && i == 2
+# if(j < i + 1)
+# {
+# continue;
+# }
+#
+# arr[j] = arr[_int_1];
+# }
+# }
+# while(gl_FragCoord.y < _float_0_0);
+# }
+#
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+# // Verify results and set color to black if failed.
+# int ref[10] = int[10](_int_0, _int_1, _int_1, _int_1, _int_1, _int_1, _int_6, _int_7, _int_8, _int_9);
+# for(int i = _int_0; i < _int_10; i++)
+# {
+# if(arr[i] != ref[i])
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 207
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %128 %144
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %11 "arr"
+ OpName %14 "buf1"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpName %50 "a"
+ OpName %53 "i"
+ OpName %71 "buf2"
+ OpMemberName %71 0 "zero"
+ OpName %73 ""
+ OpName %83 "b"
+ OpName %90 "j"
+ OpName %128 "gl_FragCoord"
+ OpName %134 "buf0"
+ OpMemberName %134 0 "_GLF_uniform_float_values"
+ OpName %136 ""
+ OpName %144 "_GLF_color"
+ OpName %158 "ref"
+ OpName %180 "i"
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 1
+ OpMemberDecorate %71 0 Offset 0
+ OpDecorate %71 Block
+ OpDecorate %73 DescriptorSet 0
+ OpDecorate %73 Binding 2
+ OpDecorate %128 BuiltIn FragCoord
+ OpDecorate %133 ArrayStride 16
+ OpMemberDecorate %134 0 Offset 0
+ OpDecorate %134 Block
+ OpDecorate %136 DescriptorSet 0
+ OpDecorate %136 Binding 0
+ OpDecorate %144 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypeInt 32 0
+ %8 = OpConstant %7 10
+ %9 = OpTypeArray %6 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpConstant %7 11
+ %13 = OpTypeArray %6 %12
+ %14 = OpTypeStruct %13
+ %15 = OpTypePointer Uniform %14
+ %16 = OpVariable %15 Uniform
+ %17 = OpConstant %6 0
+ %18 = OpConstant %6 3
+ %19 = OpTypePointer Uniform %6
+ %24 = OpConstant %6 4
+ %27 = OpConstant %6 5
+ %30 = OpConstant %6 6
+ %33 = OpConstant %6 7
+ %36 = OpConstant %6 8
+ %39 = OpConstant %6 9
+ %42 = OpConstant %6 10
+ %45 = OpConstant %6 1
+ %49 = OpTypePointer Function %6
+ %62 = OpTypeBool
+ %71 = OpTypeStruct %6
+ %72 = OpTypePointer Uniform %71
+ %73 = OpVariable %72 Uniform
+ %97 = OpConstant %6 2
+ %125 = OpTypeFloat 32
+ %126 = OpTypeVector %125 4
+ %127 = OpTypePointer Input %126
+ %128 = OpVariable %127 Input
+ %129 = OpConstant %7 1
+ %130 = OpTypePointer Input %125
+ %133 = OpTypeArray %125 %129
+ %134 = OpTypeStruct %133
+ %135 = OpTypePointer Uniform %134
+ %136 = OpVariable %135 Uniform
+ %137 = OpTypePointer Uniform %125
+ %143 = OpTypePointer Output %126
+ %144 = OpVariable %143 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %50 = OpVariable %49 Function
+ %53 = OpVariable %49 Function
+ %83 = OpVariable %49 Function
+ %90 = OpVariable %49 Function
+ %158 = OpVariable %10 Function
+ %180 = OpVariable %49 Function
+ %20 = OpAccessChain %19 %16 %17 %18
+ %21 = OpLoad %6 %20
+ %22 = OpAccessChain %19 %16 %17 %17
+ %23 = OpLoad %6 %22
+ %25 = OpAccessChain %19 %16 %17 %24
+ %26 = OpLoad %6 %25
+ %28 = OpAccessChain %19 %16 %17 %27
+ %29 = OpLoad %6 %28
+ %31 = OpAccessChain %19 %16 %17 %30
+ %32 = OpLoad %6 %31
+ %34 = OpAccessChain %19 %16 %17 %33
+ %35 = OpLoad %6 %34
+ %37 = OpAccessChain %19 %16 %17 %36
+ %38 = OpLoad %6 %37
+ %40 = OpAccessChain %19 %16 %17 %39
+ %41 = OpLoad %6 %40
+ %43 = OpAccessChain %19 %16 %17 %42
+ %44 = OpLoad %6 %43
+ %46 = OpAccessChain %19 %16 %17 %45
+ %47 = OpLoad %6 %46
+ %48 = OpCompositeConstruct %9 %21 %23 %26 %29 %32 %35 %38 %41 %44 %47
+ OpStore %11 %48
+ %51 = OpAccessChain %19 %16 %17 %18
+ %52 = OpLoad %6 %51
+ OpStore %50 %52
+ OpStore %53 %45
+ OpBranch %54
+ %54 = OpLabel
+ OpLoopMerge %56 %57 None
+ OpBranch %58
+ %58 = OpLabel
+ %59 = OpLoad %6 %53
+ %60 = OpAccessChain %19 %16 %17 %27
+ %61 = OpLoad %6 %60
+ %63 = OpSLessThan %62 %59 %61
+ OpBranchConditional %63 %55 %56
+ %55 = OpLabel
+ %64 = OpLoad %6 %50
+ %65 = OpAccessChain %19 %16 %17 %17
+ %66 = OpLoad %6 %65
+ %67 = OpSGreaterThanEqual %62 %64 %66
+ OpSelectionMerge %69 None
+ OpBranchConditional %67 %68 %69
+ %68 = OpLabel
+ OpBranch %56
+ %69 = OpLabel
+ %74 = OpAccessChain %19 %73 %17
+ %75 = OpLoad %6 %74
+ %76 = OpAccessChain %19 %16 %17 %18
+ %77 = OpLoad %6 %76
+ %78 = OpSLessThan %62 %75 %77
+ OpSelectionMerge %80 None
+ OpBranchConditional %78 %79 %80
+ %79 = OpLabel
+ %81 = OpLoad %6 %50
+ %82 = OpIAdd %6 %81 %45
+ OpStore %50 %82
+ OpBranch %80
+ %80 = OpLabel
+ %84 = OpAccessChain %19 %16 %17 %17
+ %85 = OpLoad %6 %84
+ OpStore %83 %85
+ OpBranch %86
+ %86 = OpLabel
+ OpLoopMerge %88 %89 None
+ OpBranch %87
+ %87 = OpLabel
+ OpStore %90 %17
+ OpBranch %91
+ %91 = OpLabel
+ OpLoopMerge %93 %94 None
+ OpBranch %95
+ %95 = OpLabel
+ %96 = OpLoad %6 %90
+ %98 = OpAccessChain %19 %16 %17 %97
+ %99 = OpLoad %6 %98
+ %100 = OpSLessThan %62 %96 %99
+ OpBranchConditional %100 %92 %93
+ %92 = OpLabel
+ %101 = OpLoad %6 %83
+ %102 = OpAccessChain %19 %16 %17 %39
+ %103 = OpLoad %6 %102
+ %104 = OpSGreaterThanEqual %62 %101 %103
+ OpSelectionMerge %106 None
+ OpBranchConditional %104 %105 %106
+ %105 = OpLabel
+ OpBranch %93
+ %106 = OpLabel
+ %108 = OpLoad %6 %83
+ %109 = OpIAdd %6 %108 %45
+ OpStore %83 %109
+ %110 = OpLoad %6 %90
+ %111 = OpLoad %6 %53
+ %112 = OpIAdd %6 %111 %45
+ %113 = OpSLessThan %62 %110 %112
+ OpSelectionMerge %115 None
+ OpBranchConditional %113 %114 %115
+ %114 = OpLabel
+ OpBranch %94
+ %115 = OpLabel
+ %117 = OpLoad %6 %90
+ %118 = OpAccessChain %19 %16 %17 %17
+ %119 = OpLoad %6 %118
+ %120 = OpAccessChain %49 %11 %119
+ %121 = OpLoad %6 %120
+ %122 = OpAccessChain %49 %11 %117
+ OpStore %122 %121
+ OpBranch %94
+ %94 = OpLabel
+ %123 = OpLoad %6 %90
+ %124 = OpIAdd %6 %123 %45
+ OpStore %90 %124
+ OpBranch %91
+ %93 = OpLabel
+ OpBranch %89
+ %89 = OpLabel
+ %131 = OpAccessChain %130 %128 %129
+ %132 = OpLoad %125 %131
+ %138 = OpAccessChain %137 %136 %17 %17
+ %139 = OpLoad %125 %138
+ %140 = OpFOrdLessThan %62 %132 %139
+ OpBranchConditional %140 %86 %88
+ %88 = OpLabel
+ OpBranch %57
+ %57 = OpLabel
+ %141 = OpLoad %6 %53
+ %142 = OpIAdd %6 %141 %45
+ OpStore %53 %142
+ OpBranch %54
+ %56 = OpLabel
+ %145 = OpAccessChain %19 %16 %17 %17
+ %146 = OpLoad %6 %145
+ %147 = OpConvertSToF %125 %146
+ %148 = OpAccessChain %19 %16 %17 %18
+ %149 = OpLoad %6 %148
+ %150 = OpConvertSToF %125 %149
+ %151 = OpAccessChain %19 %16 %17 %18
+ %152 = OpLoad %6 %151
+ %153 = OpConvertSToF %125 %152
+ %154 = OpAccessChain %19 %16 %17 %17
+ %155 = OpLoad %6 %154
+ %156 = OpConvertSToF %125 %155
+ %157 = OpCompositeConstruct %126 %147 %150 %153 %156
+ OpStore %144 %157
+ %159 = OpAccessChain %19 %16 %17 %18
+ %160 = OpLoad %6 %159
+ %161 = OpAccessChain %19 %16 %17 %17
+ %162 = OpLoad %6 %161
+ %163 = OpAccessChain %19 %16 %17 %17
+ %164 = OpLoad %6 %163
+ %165 = OpAccessChain %19 %16 %17 %17
+ %166 = OpLoad %6 %165
+ %167 = OpAccessChain %19 %16 %17 %17
+ %168 = OpLoad %6 %167
+ %169 = OpAccessChain %19 %16 %17 %17
+ %170 = OpLoad %6 %169
+ %171 = OpAccessChain %19 %16 %17 %36
+ %172 = OpLoad %6 %171
+ %173 = OpAccessChain %19 %16 %17 %39
+ %174 = OpLoad %6 %173
+ %175 = OpAccessChain %19 %16 %17 %42
+ %176 = OpLoad %6 %175
+ %177 = OpAccessChain %19 %16 %17 %45
+ %178 = OpLoad %6 %177
+ %179 = OpCompositeConstruct %9 %160 %162 %164 %166 %168 %170 %172 %174 %176 %178
+ OpStore %158 %179
+ %181 = OpAccessChain %19 %16 %17 %18
+ %182 = OpLoad %6 %181
+ OpStore %180 %182
+ OpBranch %183
+ %183 = OpLabel
+ OpLoopMerge %185 %186 None
+ OpBranch %187
+ %187 = OpLabel
+ %188 = OpLoad %6 %180
+ %189 = OpAccessChain %19 %16 %17 %97
+ %190 = OpLoad %6 %189
+ %191 = OpSLessThan %62 %188 %190
+ OpBranchConditional %191 %184 %185
+ %184 = OpLabel
+ %192 = OpLoad %6 %180
+ %193 = OpAccessChain %49 %11 %192
+ %194 = OpLoad %6 %193
+ %195 = OpLoad %6 %180
+ %196 = OpAccessChain %49 %158 %195
+ %197 = OpLoad %6 %196
+ %198 = OpINotEqual %62 %194 %197
+ OpSelectionMerge %200 None
+ OpBranchConditional %198 %199 %200
+ %199 = OpLabel
+ %201 = OpAccessChain %19 %16 %17 %18
+ %202 = OpLoad %6 %201
+ %203 = OpConvertSToF %125 %202
+ %204 = OpCompositeConstruct %126 %203 %203 %203 %203
+ OpStore %144 %204
+ OpBranch %200
+ %200 = OpLabel
+ OpBranch %186
+ %186 = OpLabel
+ %205 = OpLoad %6 %180
+ %206 = OpIAdd %6 %205 %45
+ OpStore %180 %206
+ OpBranch %183
+ %185 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# zero
+BUFFER variant_zero DATA_TYPE int32 STD140 DATA
+ 0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 9 10 0 2 3 4 5 6 7 8
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant_zero AS uniform DESCRIPTOR_SET 0 BINDING 2
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+ BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# '--eliminate-local-single-store'
+# '--eliminate-local-single-store'
+# '--eliminate-local-single-store'
+# '--eliminate-local-multi-store'
+# '--scalar-replacement=100'
+# '--redundancy-elimination'
+# '--eliminate-local-single-store'
+# '--eliminate-dead-inserts'
+# '--simplify-instructions'
+# '--eliminate-local-multi-store'
+# '--redundancy-elimination'
+# '--vector-dce'
+# '--eliminate-local-single-block'
+# '--eliminate-dead-code-aggressive'
+# '--eliminate-dead-branches'
+# '--merge-return'
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# '--scalar-replacement=100'
+# '--simplify-instructions'
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# '--eliminate-dead-inserts'
+# '--simplify-instructions'
+# '--eliminate-dead-branches'
+# '--merge-return'
+# '--if-conversion'
+# '--vector-dce'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: 0.0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[1];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 2]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# const int _GLF_global_loop_bound = 10;
+# int _GLF_global_loop_count = 0;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int a = _int_0;
+#
+# // Iterates once.
+# while(_GLF_global_loop_count < _GLF_global_loop_bound)
+# {
+# _GLF_global_loop_count++;
+#
+# // Iterates nine times.
+# while(_GLF_global_loop_count < _GLF_global_loop_bound)
+# {
+# _GLF_global_loop_count++;
+#
+# // Always false.
+# if(gl_FragCoord.y < _float_0_0)
+# {
+# return;
+# }
+#
+# a = _int_1;
+# }
+#
+# // Never iterated because the global loop bound has been reached.
+# for(int i = 4; i >= 0 && _GLF_global_loop_count < _GLF_global_loop_bound; i--)
+# {
+# _GLF_global_loop_count++;
+# a = _int_2;
+# }
+# }
+#
+# // Always true.
+# if(a == _int_1)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 123
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %45 %89
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "_GLF_global_loop_count"
+ OpName %15 "buf1"
+ OpMemberName %15 0 "_GLF_uniform_int_values"
+ OpName %17 ""
+ OpName %45 "gl_FragCoord"
+ OpName %51 "buf0"
+ OpMemberName %51 0 "_GLF_uniform_float_values"
+ OpName %53 ""
+ OpName %89 "_GLF_color"
+ OpDecorate %14 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 1
+ OpDecorate %45 BuiltIn FragCoord
+ OpDecorate %50 ArrayStride 16
+ OpMemberDecorate %51 0 Offset 0
+ OpDecorate %51 Block
+ OpDecorate %53 DescriptorSet 0
+ OpDecorate %53 Binding 0
+ OpDecorate %89 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Private %6
+ %8 = OpVariable %7 Private
+ %9 = OpConstant %6 0
+ %12 = OpTypeInt 32 0
+ %13 = OpConstant %12 3
+ %14 = OpTypeArray %6 %13
+ %15 = OpTypeStruct %14
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpTypePointer Uniform %6
+ %27 = OpConstant %6 10
+ %28 = OpTypeBool
+ %31 = OpConstant %6 1
+ %42 = OpTypeFloat 32
+ %43 = OpTypeVector %42 4
+ %44 = OpTypePointer Input %43
+ %45 = OpVariable %44 Input
+ %46 = OpConstant %12 1
+ %47 = OpTypePointer Input %42
+ %50 = OpTypeArray %42 %46
+ %51 = OpTypeStruct %50
+ %52 = OpTypePointer Uniform %51
+ %53 = OpVariable %52 Uniform
+ %54 = OpTypePointer Uniform %42
+ %64 = OpConstant %6 4
+ %77 = OpConstant %6 2
+ %88 = OpTypePointer Output %43
+ %89 = OpVariable %88 Output
+ %114 = OpConstant %12 0
+ %115 = OpConstantFalse %28
+ %116 = OpTypePointer Function %28
+ %118 = OpConstantTrue %28
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %117 = OpVariable %116 Function %115
+ OpSelectionMerge %112 None
+ OpSwitch %114 %113
+ %113 = OpLabel
+ OpStore %8 %9
+ %19 = OpAccessChain %18 %17 %9 %9
+ %20 = OpLoad %6 %19
+ OpBranch %21
+ %21 = OpLabel
+ %108 = OpPhi %6 %20 %113 %110 %24
+ %26 = OpLoad %6 %8
+ %29 = OpSLessThan %28 %26 %27
+ OpLoopMerge %23 %24 None
+ OpBranchConditional %29 %22 %23
+ %22 = OpLabel
+ %30 = OpLoad %6 %8
+ %32 = OpIAdd %6 %30 %31
+ OpStore %8 %32
+ OpBranch %33
+ %33 = OpLabel
+ %111 = OpPhi %6 %108 %22 %62 %36
+ %38 = OpLoad %6 %8
+ %39 = OpSLessThan %28 %38 %27
+ OpLoopMerge %35 %36 None
+ OpBranchConditional %39 %34 %35
+ %34 = OpLabel
+ %40 = OpLoad %6 %8
+ %41 = OpIAdd %6 %40 %31
+ OpStore %8 %41
+ %48 = OpAccessChain %47 %45 %46
+ %49 = OpLoad %42 %48
+ %55 = OpAccessChain %54 %53 %9 %9
+ %56 = OpLoad %42 %55
+ %57 = OpFOrdLessThan %28 %49 %56
+ OpSelectionMerge %59 None
+ OpBranchConditional %57 %58 %59
+ %58 = OpLabel
+ OpStore %117 %118
+ OpBranch %35
+ %59 = OpLabel
+ %61 = OpAccessChain %18 %17 %9 %31
+ %62 = OpLoad %6 %61
+ OpBranch %36
+ %36 = OpLabel
+ OpBranch %33
+ %35 = OpLabel
+ %120 = OpLoad %28 %117
+ OpSelectionMerge %119 None
+ OpBranchConditional %120 %23 %119
+ %119 = OpLabel
+ OpBranch %65
+ %65 = OpLabel
+ %109 = OpPhi %6 %64 %119 %81 %66
+ %110 = OpPhi %6 %111 %119 %79 %66
+ %71 = OpSGreaterThanEqual %28 %109 %9
+ %72 = OpLoad %6 %8
+ %73 = OpSLessThan %28 %72 %27
+ %74 = OpLogicalAnd %28 %71 %73
+ OpLoopMerge %67 %66 None
+ OpBranchConditional %74 %66 %67
+ %66 = OpLabel
+ %75 = OpLoad %6 %8
+ %76 = OpIAdd %6 %75 %31
+ OpStore %8 %76
+ %78 = OpAccessChain %18 %17 %9 %77
+ %79 = OpLoad %6 %78
+ %81 = OpISub %6 %109 %31
+ OpBranch %65
+ %67 = OpLabel
+ OpBranch %24
+ %24 = OpLabel
+ OpBranch %21
+ %23 = OpLabel
+ %122 = OpLoad %28 %117
+ OpSelectionMerge %121 None
+ OpBranchConditional %122 %112 %121
+ %121 = OpLabel
+ %83 = OpAccessChain %18 %17 %9 %31
+ %84 = OpLoad %6 %83
+ %85 = OpIEqual %28 %108 %84
+ OpSelectionMerge %87 None
+ OpBranchConditional %85 %86 %103
+ %86 = OpLabel
+ %92 = OpConvertSToF %42 %84
+ %95 = OpConvertSToF %42 %20
+ %102 = OpCompositeConstruct %43 %92 %95 %95 %92
+ OpStore %89 %102
+ OpBranch %87
+ %103 = OpLabel
+ %106 = OpConvertSToF %42 %20
+ %107 = OpCompositeConstruct %43 %106 %106 %106 %106
+ OpStore %89 %107
+ OpBranch %87
+ %87 = OpLabel
+ OpStore %117 %118
+ OpBranch %112
+ %112 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 2
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 1
+ BIND BUFFER variant__GLF_uniform_float_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0]
+# layout(set = 0, binding = 0) uniform buf0 {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# const int _GLF_global_loop_bound = 10;
+# int _GLF_global_loop_count = 0;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+# // Iterated once.
+# for(int i = _int_1; i > _int_0 && _GLF_global_loop_count < _GLF_global_loop_bound; i--)
+# {
+# // Iterated once.
+# for(int i = _int_1; i != _int_0 && _GLF_global_loop_count < _GLF_global_loop_bound; i--)
+# {
+# // Uninitialized here, but this gets a value in the while loop below.
+# vec4 v;
+#
+# // Iterated ten times.
+# while(_GLF_global_loop_count < _GLF_global_loop_bound)
+# {
+# _GLF_global_loop_count++;
+# v = _GLF_color;
+# }
+#
+# _GLF_color = vec4(_int_0);
+#
+# // Always true.
+# if(_int_1 > _int_0)
+# {
+# _GLF_color = v;
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 101
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %13
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "_GLF_global_loop_count"
+ OpName %13 "_GLF_color"
+ OpName %17 "buf0"
+ OpMemberName %17 0 "_GLF_uniform_int_values"
+ OpName %19 ""
+ OpName %36 "i"
+ OpName %53 "i"
+ OpName %78 "v"
+ OpDecorate %13 Location 0
+ OpDecorate %16 ArrayStride 16
+ OpMemberDecorate %17 0 Offset 0
+ OpDecorate %17 Block
+ OpDecorate %19 DescriptorSet 0
+ OpDecorate %19 Binding 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Private %6
+ %8 = OpVariable %7 Private
+ %9 = OpConstant %6 0
+ %10 = OpTypeFloat 32
+ %11 = OpTypeVector %10 4
+ %12 = OpTypePointer Output %11
+ %13 = OpVariable %12 Output
+ %14 = OpTypeInt 32 0
+ %15 = OpConstant %14 2
+ %16 = OpTypeArray %6 %15
+ %17 = OpTypeStruct %16
+ %18 = OpTypePointer Uniform %17
+ %19 = OpVariable %18 Uniform
+ %20 = OpTypePointer Uniform %6
+ %24 = OpConstant %6 1
+ %35 = OpTypePointer Function %6
+ %47 = OpTypeBool
+ %50 = OpConstant %6 10
+ %77 = OpTypePointer Function %11
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %36 = OpVariable %35 Function
+ %53 = OpVariable %35 Function
+ %78 = OpVariable %77 Function
+ OpStore %8 %9
+ %21 = OpAccessChain %20 %19 %9 %9
+ %22 = OpLoad %6 %21
+ %23 = OpConvertSToF %10 %22
+ %25 = OpAccessChain %20 %19 %9 %24
+ %26 = OpLoad %6 %25
+ %27 = OpConvertSToF %10 %26
+ %28 = OpAccessChain %20 %19 %9 %24
+ %29 = OpLoad %6 %28
+ %30 = OpConvertSToF %10 %29
+ %31 = OpAccessChain %20 %19 %9 %9
+ %32 = OpLoad %6 %31
+ %33 = OpConvertSToF %10 %32
+ %34 = OpCompositeConstruct %11 %23 %27 %30 %33
+ OpStore %13 %34
+ %37 = OpAccessChain %20 %19 %9 %9
+ %38 = OpLoad %6 %37
+ OpStore %36 %38
+ OpBranch %39
+ %39 = OpLabel
+ OpLoopMerge %41 %42 None
+ OpBranch %43
+ %43 = OpLabel
+ %44 = OpLoad %6 %36
+ %45 = OpAccessChain %20 %19 %9 %24
+ %46 = OpLoad %6 %45
+ %48 = OpSGreaterThan %47 %44 %46
+ %49 = OpLoad %6 %8
+ %51 = OpSLessThan %47 %49 %50
+ %52 = OpLogicalAnd %47 %48 %51
+ OpBranchConditional %52 %40 %41
+ %40 = OpLabel
+ %54 = OpAccessChain %20 %19 %9 %9
+ %55 = OpLoad %6 %54
+ OpStore %53 %55
+ OpBranch %56
+ %56 = OpLabel
+ OpLoopMerge %58 %59 None
+ OpBranch %60
+ %60 = OpLabel
+ %61 = OpLoad %6 %53
+ %62 = OpAccessChain %20 %19 %9 %24
+ %63 = OpLoad %6 %62
+ %64 = OpINotEqual %47 %61 %63
+ %65 = OpLoad %6 %8
+ %66 = OpSLessThan %47 %65 %50
+ %67 = OpLogicalAnd %47 %64 %66
+ OpBranchConditional %67 %57 %58
+ %57 = OpLabel
+ OpBranch %68
+ %68 = OpLabel
+ OpLoopMerge %70 %71 None
+ OpBranch %72
+ %72 = OpLabel
+ %73 = OpLoad %6 %8
+ %74 = OpSLessThan %47 %73 %50
+ OpBranchConditional %74 %69 %70
+ %69 = OpLabel
+ %75 = OpLoad %6 %8
+ %76 = OpIAdd %6 %75 %24
+ OpStore %8 %76
+ %79 = OpLoad %11 %13
+ OpStore %78 %79
+ OpBranch %71
+ %71 = OpLabel
+ OpBranch %68
+ %70 = OpLabel
+ %80 = OpAccessChain %20 %19 %9 %24
+ %81 = OpLoad %6 %80
+ %82 = OpConvertSToF %10 %81
+ %83 = OpCompositeConstruct %11 %82 %82 %82 %82
+ OpStore %13 %83
+ %84 = OpAccessChain %20 %19 %9 %9
+ %85 = OpLoad %6 %84
+ %86 = OpAccessChain %20 %19 %9 %24
+ %87 = OpLoad %6 %86
+ %88 = OpSGreaterThan %47 %85 %87
+ OpSelectionMerge %90 None
+ OpBranchConditional %88 %89 %92
+ %89 = OpLabel
+ %91 = OpLoad %11 %78
+ OpStore %13 %91
+ OpBranch %90
+ %92 = OpLabel
+ %93 = OpAccessChain %20 %19 %9 %24
+ %94 = OpLoad %6 %93
+ %95 = OpConvertSToF %10 %94
+ %96 = OpCompositeConstruct %11 %95 %95 %95 %95
+ OpStore %13 %96
+ OpBranch %90
+ %90 = OpLabel
+ OpBranch %59
+ %59 = OpLabel
+ %97 = OpLoad %6 %53
+ %98 = OpISub %6 %97 %24
+ OpStore %53 %98
+ OpBranch %56
+ %58 = OpLabel
+ OpBranch %42
+ %42 = OpLabel
+ %99 = OpLoad %6 %36
+ %100 = OpISub %6 %99 %24
+ OpStore %36 %100
+ OpBranch %39
+ %41 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_4 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_2 _GLF_uniform_int_values[2]
+# #define _int_0 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [4, 1, 2, 0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int a = _int_0;
+#
+# // Iterated once.
+# for(int i = _int_0; i < _int_1; i++)
+# {
+# {
+# int j = _int_1, i = i;
+#
+# // Iterated twice.
+# while(i <= _int_1)
+# {
+# a++;
+#
+# // Never iterated.
+# for(j = 1; j < i; j++)
+# {
+# a = _int_0;
+# // This would make the while loop infinite, but this is never executed.
+# i = (_int_4 * i) / 1000;
+# }
+#
+# i++;
+# }
+# }
+# }
+#
+# // Always true.
+# if(a == _int_2)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 101
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %82
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %20 "i"
+ OpName %34 "j"
+ OpName %37 "i"
+ OpName %82 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %82 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 4
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpConstant %6 3
+ %17 = OpTypePointer Uniform %6
+ %29 = OpConstant %6 1
+ %32 = OpTypeBool
+ %64 = OpConstant %6 1000
+ %73 = OpConstant %6 2
+ %79 = OpTypeFloat 32
+ %80 = OpTypeVector %79 4
+ %81 = OpTypePointer Output %80
+ %82 = OpVariable %81 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %20 = OpVariable %7 Function
+ %34 = OpVariable %7 Function
+ %37 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ %21 = OpAccessChain %17 %14 %15 %16
+ %22 = OpLoad %6 %21
+ OpStore %20 %22
+ OpBranch %23
+ %23 = OpLabel
+ OpLoopMerge %25 %26 None
+ OpBranch %27
+ %27 = OpLabel
+ %28 = OpLoad %6 %20
+ %30 = OpAccessChain %17 %14 %15 %29
+ %31 = OpLoad %6 %30
+ %33 = OpSLessThan %32 %28 %31
+ OpBranchConditional %33 %24 %25
+ %24 = OpLabel
+ %35 = OpAccessChain %17 %14 %15 %29
+ %36 = OpLoad %6 %35
+ OpStore %34 %36
+ %38 = OpLoad %6 %20
+ OpStore %37 %38
+ OpBranch %39
+ %39 = OpLabel
+ OpLoopMerge %41 %42 None
+ OpBranch %43
+ %43 = OpLabel
+ %44 = OpLoad %6 %37
+ %45 = OpAccessChain %17 %14 %15 %29
+ %46 = OpLoad %6 %45
+ %47 = OpSLessThanEqual %32 %44 %46
+ OpBranchConditional %47 %40 %41
+ %40 = OpLabel
+ %48 = OpLoad %6 %8
+ %49 = OpIAdd %6 %48 %29
+ OpStore %8 %49
+ OpStore %34 %29
+ OpBranch %50
+ %50 = OpLabel
+ OpLoopMerge %52 %53 None
+ OpBranch %54
+ %54 = OpLabel
+ %55 = OpLoad %6 %34
+ %56 = OpLoad %6 %37
+ %57 = OpSLessThan %32 %55 %56
+ OpBranchConditional %57 %51 %52
+ %51 = OpLabel
+ %58 = OpAccessChain %17 %14 %15 %16
+ %59 = OpLoad %6 %58
+ OpStore %8 %59
+ %60 = OpAccessChain %17 %14 %15 %15
+ %61 = OpLoad %6 %60
+ %62 = OpLoad %6 %37
+ %63 = OpIMul %6 %61 %62
+ %65 = OpSDiv %6 %63 %64
+ OpStore %37 %65
+ OpBranch %53
+ %53 = OpLabel
+ %66 = OpLoad %6 %34
+ %67 = OpIAdd %6 %66 %29
+ OpStore %34 %67
+ OpBranch %50
+ %52 = OpLabel
+ %68 = OpLoad %6 %37
+ %69 = OpIAdd %6 %68 %29
+ OpStore %37 %69
+ OpBranch %42
+ %42 = OpLabel
+ OpBranch %39
+ %41 = OpLabel
+ OpBranch %26
+ %26 = OpLabel
+ %70 = OpLoad %6 %20
+ %71 = OpIAdd %6 %70 %29
+ OpStore %20 %71
+ OpBranch %23
+ %25 = OpLabel
+ %72 = OpLoad %6 %8
+ %74 = OpAccessChain %17 %14 %15 %73
+ %75 = OpLoad %6 %74
+ %76 = OpIEqual %32 %72 %75
+ OpSelectionMerge %78 None
+ OpBranchConditional %76 %77 %96
+ %77 = OpLabel
+ %83 = OpAccessChain %17 %14 %15 %29
+ %84 = OpLoad %6 %83
+ %85 = OpConvertSToF %79 %84
+ %86 = OpAccessChain %17 %14 %15 %16
+ %87 = OpLoad %6 %86
+ %88 = OpConvertSToF %79 %87
+ %89 = OpAccessChain %17 %14 %15 %16
+ %90 = OpLoad %6 %89
+ %91 = OpConvertSToF %79 %90
+ %92 = OpAccessChain %17 %14 %15 %29
+ %93 = OpLoad %6 %92
+ %94 = OpConvertSToF %79 %93
+ %95 = OpCompositeConstruct %80 %85 %88 %91 %94
+ OpStore %82 %95
+ OpBranch %78
+ %96 = OpLabel
+ %97 = OpAccessChain %17 %14 %15 %16
+ %98 = OpLoad %6 %97
+ %99 = OpConvertSToF %79 %98
+ %100 = OpCompositeConstruct %80 %99 %99 %99 %99
+ OpStore %82 %100
+ OpBranch %78
+ %78 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 4 1 2 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+#
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_3 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 3]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# struct S {
+# int data;
+# };
+#
+# S arr[10] = S[10](S(0), S(1), S(2), S(3), S(4), S(5), S(6), S(7), S(8), S(9));
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void func0(inout S s)
+# {
+# // Iterates once.
+# for(int i = 1; i > 0; i--)
+# {
+# s.data = -_int_1;
+# }
+# }
+#
+# int func1()
+# {
+# int index = _int_0;
+#
+# for(int i = _int_0; i < _int_3; i++)
+# {
+# // True on the second iteration.
+# if(arr[index].data == -_int_1)
+# {
+# return _int_1;
+# }
+#
+# index = _int_1;
+# }
+#
+# // Never executed.
+# return _int_0;
+# }
+#
+# void main()
+# {
+# // Sets arr[0].data to -1.
+# func0(arr[_int_1]);
+#
+# // Always true.
+# if(func1() == _int_1)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 137
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %118
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %7 "S"
+ OpMemberName %7 0 "data"
+ OpName %11 "func0(struct-S-i11;"
+ OpName %10 "s"
+ OpName %14 "func1("
+ OpName %20 "arr"
+ OpName %43 "i"
+ OpName %54 "buf0"
+ OpMemberName %54 0 "_GLF_uniform_int_values"
+ OpName %56 ""
+ OpName %64 "index"
+ OpName %67 "i"
+ OpName %102 "param"
+ OpName %118 "_GLF_color"
+ OpDecorate %53 ArrayStride 16
+ OpMemberDecorate %54 0 Offset 0
+ OpDecorate %54 Block
+ OpDecorate %56 DescriptorSet 0
+ OpDecorate %56 Binding 0
+ OpDecorate %118 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypeStruct %6
+ %8 = OpTypePointer Function %7
+ %9 = OpTypeFunction %2 %8
+ %13 = OpTypeFunction %6
+ %16 = OpTypeInt 32 0
+ %17 = OpConstant %16 10
+ %18 = OpTypeArray %7 %17
+ %19 = OpTypePointer Private %18
+ %20 = OpVariable %19 Private
+ %21 = OpConstant %6 0
+ %22 = OpConstantComposite %7 %21
+ %23 = OpConstant %6 1
+ %24 = OpConstantComposite %7 %23
+ %25 = OpConstant %6 2
+ %26 = OpConstantComposite %7 %25
+ %27 = OpConstant %6 3
+ %28 = OpConstantComposite %7 %27
+ %29 = OpConstant %6 4
+ %30 = OpConstantComposite %7 %29
+ %31 = OpConstant %6 5
+ %32 = OpConstantComposite %7 %31
+ %33 = OpConstant %6 6
+ %34 = OpConstantComposite %7 %33
+ %35 = OpConstant %6 7
+ %36 = OpConstantComposite %7 %35
+ %37 = OpConstant %6 8
+ %38 = OpConstantComposite %7 %37
+ %39 = OpConstant %6 9
+ %40 = OpConstantComposite %7 %39
+ %41 = OpConstantComposite %18 %22 %24 %26 %28 %30 %32 %34 %36 %38 %40
+ %42 = OpTypePointer Function %6
+ %50 = OpTypeBool
+ %52 = OpConstant %16 3
+ %53 = OpTypeArray %6 %52
+ %54 = OpTypeStruct %53
+ %55 = OpTypePointer Uniform %54
+ %56 = OpVariable %55 Uniform
+ %57 = OpTypePointer Uniform %6
+ %80 = OpTypePointer Private %6
+ %103 = OpTypePointer Private %7
+ %115 = OpTypeFloat 32
+ %116 = OpTypeVector %115 4
+ %117 = OpTypePointer Output %116
+ %118 = OpVariable %117 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %102 = OpVariable %8 Function
+ OpStore %20 %41
+ %100 = OpAccessChain %57 %56 %21 %21
+ %101 = OpLoad %6 %100
+ %104 = OpAccessChain %103 %20 %101
+ %105 = OpLoad %7 %104
+ OpStore %102 %105
+ %106 = OpFunctionCall %2 %11 %102
+ %107 = OpLoad %7 %102
+ %108 = OpAccessChain %103 %20 %101
+ OpStore %108 %107
+ %109 = OpFunctionCall %6 %14
+ %110 = OpAccessChain %57 %56 %21 %21
+ %111 = OpLoad %6 %110
+ %112 = OpIEqual %50 %109 %111
+ OpSelectionMerge %114 None
+ OpBranchConditional %112 %113 %132
+ %113 = OpLabel
+ %119 = OpAccessChain %57 %56 %21 %21
+ %120 = OpLoad %6 %119
+ %121 = OpConvertSToF %115 %120
+ %122 = OpAccessChain %57 %56 %21 %23
+ %123 = OpLoad %6 %122
+ %124 = OpConvertSToF %115 %123
+ %125 = OpAccessChain %57 %56 %21 %23
+ %126 = OpLoad %6 %125
+ %127 = OpConvertSToF %115 %126
+ %128 = OpAccessChain %57 %56 %21 %21
+ %129 = OpLoad %6 %128
+ %130 = OpConvertSToF %115 %129
+ %131 = OpCompositeConstruct %116 %121 %124 %127 %130
+ OpStore %118 %131
+ OpBranch %114
+ %132 = OpLabel
+ %133 = OpAccessChain %57 %56 %21 %23
+ %134 = OpLoad %6 %133
+ %135 = OpConvertSToF %115 %134
+ %136 = OpCompositeConstruct %116 %135 %135 %135 %135
+ OpStore %118 %136
+ OpBranch %114
+ %114 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %11 = OpFunction %2 None %9
+ %10 = OpFunctionParameter %8
+ %12 = OpLabel
+ %43 = OpVariable %42 Function
+ OpStore %43 %23
+ OpBranch %44
+ %44 = OpLabel
+ OpLoopMerge %46 %47 None
+ OpBranch %48
+ %48 = OpLabel
+ %49 = OpLoad %6 %43
+ %51 = OpSGreaterThan %50 %49 %21
+ OpBranchConditional %51 %45 %46
+ %45 = OpLabel
+ %58 = OpAccessChain %57 %56 %21 %21
+ %59 = OpLoad %6 %58
+ %60 = OpSNegate %6 %59
+ %61 = OpAccessChain %42 %10 %21
+ OpStore %61 %60
+ OpBranch %47
+ %47 = OpLabel
+ %62 = OpLoad %6 %43
+ %63 = OpISub %6 %62 %23
+ OpStore %43 %63
+ OpBranch %44
+ %46 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %14 = OpFunction %6 None %13
+ %15 = OpLabel
+ %64 = OpVariable %42 Function
+ %67 = OpVariable %42 Function
+ %65 = OpAccessChain %57 %56 %21 %23
+ %66 = OpLoad %6 %65
+ OpStore %64 %66
+ %68 = OpAccessChain %57 %56 %21 %23
+ %69 = OpLoad %6 %68
+ OpStore %67 %69
+ OpBranch %70
+ %70 = OpLabel
+ OpLoopMerge %72 %73 None
+ OpBranch %74
+ %74 = OpLabel
+ %75 = OpLoad %6 %67
+ %76 = OpAccessChain %57 %56 %21 %25
+ %77 = OpLoad %6 %76
+ %78 = OpSLessThan %50 %75 %77
+ OpBranchConditional %78 %71 %72
+ %71 = OpLabel
+ %79 = OpLoad %6 %64
+ %81 = OpAccessChain %80 %20 %79 %21
+ %82 = OpLoad %6 %81
+ %83 = OpAccessChain %57 %56 %21 %21
+ %84 = OpLoad %6 %83
+ %85 = OpSNegate %6 %84
+ %86 = OpIEqual %50 %82 %85
+ OpSelectionMerge %88 None
+ OpBranchConditional %86 %87 %88
+ %87 = OpLabel
+ %89 = OpAccessChain %57 %56 %21 %21
+ %90 = OpLoad %6 %89
+ OpReturnValue %90
+ %88 = OpLabel
+ %92 = OpAccessChain %57 %56 %21 %21
+ %93 = OpLoad %6 %92
+ OpStore %64 %93
+ OpBranch %73
+ %73 = OpLabel
+ %94 = OpLoad %6 %67
+ %95 = OpIAdd %6 %94 %23
+ OpStore %67 %95
+ OpBranch %70
+ %72 = OpLabel
+ %96 = OpAccessChain %57 %56 %21 %23
+ %97 = OpLoad %6 %96
+ OpReturnValue %97
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 3
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2022 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# A test for a coverage-gap found by the GraphicsFuzz project.
+
+# Short description: A fragment shader that covers specific LLVM code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '--eliminate-local-single-store'
+# '--convert-local-access-chains'
+# '--if-conversion'
+# '--eliminate-local-single-block'
+# '--simplify-instructions'
+# '--inline-entry-points-exhaustive'
+# '--private-to-local'
+# '--convert-local-access-chains'
+# '--eliminate-dead-branches'
+# '--merge-return'
+# '--combine-access-chains'
+# '--reduce-load-size'
+# '--reduce-load-size'
+# '--combine-access-chains'
+# '--vector-dce'
+# '--eliminate-dead-branches'
+# '--redundancy-elimination'
+# '--inline-entry-points-exhaustive'
+# '--eliminate-dead-branches'
+# '--merge-blocks'
+# '--eliminate-dead-branches'
+# '--eliminate-local-single-block'
+# '--inline-entry-points-exhaustive'
+# '--if-conversion'
+# spirv-opt commit hash: a0370efd589be33d5d9a85cfde2f85841b3755af
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 320 es
+# #define _int_3 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [3, 1, 0]
+# layout(set = 0, binding = 0) uniform buf0 {
+# int _GLF_uniform_int_values[3];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // f = (0, 1) * max((1, 1), (2, 3)) = (0, 1) * (2, 3) = 0 * 2 + 1 * 3 = 3
+# float f = dot(vec2(0, 1), max(vec2(_int_1, 1), vec2(2, 3)));
+#
+# // Always true.
+# if(int(f) == _int_3)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 60
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %42
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %8 "f"
+ OpName %17 "buf0"
+ OpMemberName %17 0 "_GLF_uniform_int_values"
+ OpName %19 ""
+ OpName %42 "_GLF_color"
+ OpDecorate %16 ArrayStride 16
+ OpMemberDecorate %17 0 Offset 0
+ OpDecorate %17 Block
+ OpDecorate %19 DescriptorSet 0
+ OpDecorate %19 Binding 0
+ OpDecorate %42 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeVector %6 2
+ %10 = OpConstant %6 0
+ %11 = OpConstant %6 1
+ %12 = OpConstantComposite %9 %10 %11
+ %13 = OpTypeInt 32 1
+ %14 = OpTypeInt 32 0
+ %15 = OpConstant %14 3
+ %16 = OpTypeArray %13 %15
+ %17 = OpTypeStruct %16
+ %18 = OpTypePointer Uniform %17
+ %19 = OpVariable %18 Uniform
+ %20 = OpConstant %13 0
+ %21 = OpConstant %13 1
+ %22 = OpTypePointer Uniform %13
+ %27 = OpConstant %6 2
+ %28 = OpConstant %6 3
+ %29 = OpConstantComposite %9 %27 %28
+ %36 = OpTypeBool
+ %40 = OpTypeVector %6 4
+ %41 = OpTypePointer Output %40
+ %42 = OpVariable %41 Output
+ %46 = OpConstant %13 2
+ %58 = OpConstantComposite %40 %10 %10 %10 %10
+ %59 = OpUndef %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %23 = OpAccessChain %22 %19 %20 %21
+ %24 = OpLoad %13 %23
+ %26 = OpCompositeConstruct %9 %59 %11
+ %30 = OpExtInst %9 %1 FMax %26 %29
+ %31 = OpCompositeExtract %6 %30 1
+ OpStore %8 %31
+ %33 = OpConvertFToS %13 %31
+ %34 = OpAccessChain %22 %19 %20 %20
+ %35 = OpLoad %13 %34
+ %37 = OpIEqual %36 %33 %35
+ OpSelectionMerge %39 None
+ OpBranchConditional %37 %38 %57
+ %38 = OpLabel
+ %45 = OpConvertSToF %6 %24
+ %47 = OpAccessChain %22 %19 %20 %46
+ %48 = OpLoad %13 %47
+ %49 = OpConvertSToF %6 %48
+ %56 = OpCompositeConstruct %40 %45 %49 %49 %45
+ OpStore %42 %56
+ OpBranch %39
+ %57 = OpLabel
+ OpStore %42 %58
+ OpBranch %39
+ %39 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 1 0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 32 32
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant__GLF_uniform_int_values AS uniform DESCRIPTOR_SET 0 BINDING 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 32 32
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 32 32 EQ_RGBA 255 0 0 255
{ "cov-function-loop-same-conditions-multiple-times-struct-array.amber", "cov-function-loop-same-conditions-multiple-times-struct-array", "A fragment shader that covers specific LLVM code paths" },
{ "cov-function-nested-do-whiles-looped-once.amber", "cov-function-nested-do-whiles-looped-once", "A fragment shader that covers specific LLVM code paths" },
{ "cov-function-nested-loops-break-early-never-discard.amber", "cov-function-nested-loops-break-early-never-discard", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-function-nested-loops-limit-uniform-xor-uniform.amber", "cov-function-nested-loops-limit-uniform-xor-uniform", "A fragment shader that covers specific LLVM code paths" },
{ "cov-function-trivial-switch-case.amber", "cov-function-trivial-switch-case", "A fragment shader that covers specific LLVM code paths" },
{ "cov-function-two-loops-limit-using-arguments-array-element-copies.amber", "cov-function-two-loops-limit-using-arguments-array-element-copies", "A fragment shader that covers specific LLVM code paths" },
{ "cov-function-undefined-shift-left-index-array-with-return-value.amber", "cov-function-undefined-shift-left-index-array-with-return-value", "A fragment shader that covers specific LLVM code paths" },
{ "cov-liveinterval-different-dest.amber", "cov-liveinterval-different-dest", "A fragment shader that covers a specific live interval code path." },
{ "cov-loop-abs-multiply-offset.amber", "cov-loop-abs-multiply-offset", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-array-element-copy-index-clamp-sign.amber", "cov-loop-array-element-copy-index-clamp-sign", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-loop-array-index-decrement-never-negative.amber", "cov-loop-array-index-decrement-never-negative", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-break-after-first-iteration-set-array-element.amber", "cov-loop-break-after-first-iteration-set-array-element", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-break-floor-nan-never-executed.amber", "cov-loop-break-floor-nan-never-executed", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-clamp-to-one-empty-condition.amber", "cov-loop-clamp-to-one-empty-condition", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-condition-clamp-vec-of-ones.amber", "cov-loop-condition-clamp-vec-of-ones", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-condition-divide-by-uniform-always-false.amber", "cov-loop-condition-divide-by-uniform-always-false", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-condition-double-negate.amber", "cov-loop-condition-double-negate", "A fragment shader that covers specific NIR code paths" },
+{ "cov-loop-condition-filter-some-iterations-never-discard.amber", "cov-loop-condition-filter-some-iterations-never-discard", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-condition-logical-or-never-iterated.amber", "cov-loop-condition-logical-or-never-iterated", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-dfdx-constant-divide.amber", "cov-loop-dfdx-constant-divide", "A fragment shader that covers specific patch optimization code paths" },
{ "cov-loop-exit-conditions-sampler-struct-integer-variable.amber", "cov-loop-exit-conditions-sampler-struct-integer-variable", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-divide-uninitialized-vector-min-unused.amber", "cov-loop-divide-uninitialized-vector-min-unused", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-findmsb-findlsb.amber", "cov-loop-findmsb-findlsb", "A fragment shader that covers specific simplification and value tracking paths" },
{ "cov-loop-fragcoord-identical-condition.amber", "cov-loop-fragcoord-identical-condition", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-loop-increase-iterator-condition-uniform-copy-array-elements.amber", "cov-loop-increase-iterator-condition-uniform-copy-array-elements", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-increment-array-elements-clamp-index.amber", "cov-loop-increment-array-elements-clamp-index", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-increment-integer-findmsb-minus-uniform.amber", "cov-loop-increment-integer-findmsb-minus-uniform", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-increment-integer-set-output-color-break.amber", "cov-loop-increment-integer-set-output-color-break", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-increment-matrix-element-break-after-first-iteration.amber", "cov-loop-increment-matrix-element-break-after-first-iteration", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-increment-or-divide-by-loop-index.amber", "cov-loop-increment-or-divide-by-loop-index", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-integer-half-minus-one.amber", "cov-loop-integer-half-minus-one", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-loop-iterator-plus-one-variable-outside-index-array.amber", "cov-loop-iterator-plus-one-variable-outside-index-array", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-loop-limiter-min-findlsb.amber", "cov-loop-limiter-min-findlsb", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-loop-limiter-uniform-bitwise-and-one-always-break.amber", "cov-loop-limiter-uniform-bitwise-and-one-always-break", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-logical-xor.amber", "cov-loop-logical-xor", "A fragment shader that covers specific NIR code paths" },
+{ "cov-loop-replace-output-color-restore-original.amber", "cov-loop-replace-output-color-restore-original", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-returns-behind-true-and-false.amber", "cov-loop-returns-behind-true-and-false", "A fragment shader that covers specific NIR code paths" },
{ "cov-loop-set-vector-components-pow-two.amber", "cov-loop-set-vector-components-pow-two", "A fragment shader that covers specific LLVM code paths" },
{ "cov-loop-start-from-one-switch-case-invalid-color-never-executed.amber", "cov-loop-start-from-one-switch-case-invalid-color-never-executed", "A fragment shader that covers specific LLVM code paths" },
{ "cov-multiple-fragcoord-conditions-never-return-color-uninitialized.amber", "cov-multiple-fragcoord-conditions-never-return-color-uninitialized", "A fragment shader that covers specific LLVM code paths" },
{ "cov-multiple-loops-same-condition-always-false-global-loop-counter.amber", "cov-multiple-loops-same-condition-always-false-global-loop-counter", "A fragment shader that covers specific LLVM code paths" },
{ "cov-multiple-one-iteration-loops-global-counter-write-matrices.amber", "cov-multiple-one-iteration-loops-global-counter-write-matrices", "A fragment shader that covers specific BRW code paths" },
+{ "cov-negative-integer-bitwise-or-uniform-increment-loop.amber", "cov-negative-integer-bitwise-or-uniform-increment-loop", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-functions-accumulate-global-matrix.amber", "cov-nested-functions-accumulate-global-matrix", "A fragment shader that covers specific NIR code paths" },
{ "cov-nested-functions-compare-fragcood-length-zero-vector.amber", "cov-nested-functions-compare-fragcood-length-zero-vector", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-functions-loop-assign-global-array-element.amber", "cov-nested-functions-loop-assign-global-array-element", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loop-not-greater-than-increment-array-element.amber", "cov-nested-loop-not-greater-than-increment-array-element", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loop-undefined-smoothstep-never-executed.amber", "cov-nested-loop-undefined-smoothstep-never-executed", "A fragment shader that covers specific BRW code paths" },
{ "cov-nested-loops-clamp-ivec-push-constant-increment-global-counter.amber", "cov-nested-loops-clamp-ivec-push-constant-increment-global-counter", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-nested-loops-copy-array-elements-skip-first.amber", "cov-nested-loops-copy-array-elements-skip-first", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-different-iteration-rates-function-copy-array-elements.amber", "cov-nested-loops-different-iteration-rates-function-copy-array-elements", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-divide-integer-constant-always-zero.amber", "cov-nested-loops-divide-integer-constant-always-zero", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-decrease-vector-component-by-matrix-element-global-loop-counter.amber", "cov-nested-loops-decrease-vector-component-by-matrix-element-global-loop-counter", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-float-array-select-by-fragcoord.amber", "cov-nested-loops-float-array-select-by-fragcoord", "A fragment shader that covers specific BRW code paths" },
{ "cov-nested-loops-float-bits-to-int-increment-array.amber", "cov-nested-loops-float-bits-to-int-increment-array", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-nested-loops-fragcoord-never-return-descending-loop.amber", "cov-nested-loops-fragcoord-never-return-descending-loop", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-global-counter-func-set-struct-field.amber", "cov-nested-loops-global-counter-func-set-struct-field", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-global-counter-increment-single-element.amber", "cov-nested-loops-global-counter-increment-single-element", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-global-loop-counter-do-while-accumulate-float.amber", "cov-nested-loops-global-loop-counter-do-while-accumulate-float", "A fragment shader that covers specific BRW code paths" },
{ "cov-nested-loops-global-loop-counter-fragcoord-negative-always-false.amber", "cov-nested-loops-global-loop-counter-fragcoord-negative-always-false", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-global-loop-counter-iterator-dependency.amber", "cov-nested-loops-global-loop-counter-iterator-dependency", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-nested-loops-global-loop-counter-output-color-from-backup.amber", "cov-nested-loops-global-loop-counter-output-color-from-backup", "A fragment shader that covers specific LLVM code paths" },
+{ "cov-nested-loops-identical-iterator-names-multiply-divide.amber", "cov-nested-loops-identical-iterator-names-multiply-divide", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-increase-integer-dot-product.amber", "cov-nested-loops-increase-integer-dot-product", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-redundant-condition.amber", "cov-nested-loops-redundant-condition", "A fragment shader that covers specific LLVM code paths" },
{ "cov-nested-loops-sample-opposite-corners.amber", "cov-nested-loops-sample-opposite-corners", "A fragment shader that covers specific LLVM code paths" },
{ "cov-texel-double-negation.amber", "cov-texel-double-negation", "A fragment shader that covers specific NIR code paths" },
{ "cov-transpose-multiply.amber", "cov-transpose-multiply", "A fragment shader that covers specific NIR code paths" },
{ "cov-trunc-fract-always-zero.amber", "cov-trunc-fract-always-zero", "A fragment shader that covers specific NIR code paths" },
+{ "cov-two-functions-modify-struct-array-element-return-from-loop.amber", "cov-two-functions-modify-struct-array-element-return-from-loop", "A fragment shader that covers specific LLVM code paths" },
{ "cov-two-loops-global-loop-counter-shift-right-zero-increment-array-element.amber", "cov-two-loops-global-loop-counter-shift-right-zero-increment-array-element", "A fragment shader that covers specific LLVM code paths" },
{ "cov-two-nested-loops-switch-case-matrix-array-increment.amber", "cov-two-nested-loops-switch-case-matrix-array-increment", "A fragment shader that covers specific LLVM code paths" },
{ "cov-types-return-in-main-never-hit.amber", "cov-types-return-in-main-never-hit", "A fragment shader that covers a specific types optimization path." },
{ "cov-value-tracking-selection-dag-negation-clamp-loop.amber", "cov-value-tracking-selection-dag-negation-clamp-loop", "A fragment shader that calculates negation of clamped loop iterator values" },
{ "cov-value-tracking-uniform-incident.amber", "cov-value-tracking-uniform-incident", "A fragment shader that covers a specific value tracking code path" },
{ "cov-variable-copy-in-function-tex-sample.amber", "cov-variable-copy-in-function-tex-sample", "A fragment shader that covers specific NIR code paths" },
+{ "cov-vec2-dot-max-uniform.amber", "cov-vec2-dot-max-uniform", "A fragment shader that covers specific LLVM code paths" },
{ "cov-vec2-dot-minus-negative-zero.amber", "cov-vec2-dot-minus-negative-zero", "A fragment shader that covers specific LLVM code paths" },
{ "cov-vec2-duplicate-min-always-half.amber", "cov-vec2-duplicate-min-always-half", "A fragment shader that covers specific LLVM code paths" },
{ "cov-vector-dce-inc-unused-comp.amber", "cov-vector-dce-inc-unused-comp", "A fragment shader that covers a specific vector DCE path." },
dEQP-VK.graphicsfuzz.cov-function-loop-same-conditions-multiple-times-struct-array
dEQP-VK.graphicsfuzz.cov-function-nested-do-whiles-looped-once
dEQP-VK.graphicsfuzz.cov-function-nested-loops-break-early-never-discard
+dEQP-VK.graphicsfuzz.cov-function-nested-loops-limit-uniform-xor-uniform
dEQP-VK.graphicsfuzz.cov-function-trivial-switch-case
dEQP-VK.graphicsfuzz.cov-function-two-loops-limit-using-arguments-array-element-copies
dEQP-VK.graphicsfuzz.cov-function-undefined-shift-left-index-array-with-return-value
dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
dEQP-VK.graphicsfuzz.cov-loop-abs-multiply-offset
dEQP-VK.graphicsfuzz.cov-loop-array-element-copy-index-clamp-sign
+dEQP-VK.graphicsfuzz.cov-loop-array-index-decrement-never-negative
dEQP-VK.graphicsfuzz.cov-loop-break-after-first-iteration-set-array-element
dEQP-VK.graphicsfuzz.cov-loop-break-floor-nan-never-executed
dEQP-VK.graphicsfuzz.cov-loop-clamp-to-one-empty-condition
dEQP-VK.graphicsfuzz.cov-loop-condition-clamp-vec-of-ones
dEQP-VK.graphicsfuzz.cov-loop-condition-divide-by-uniform-always-false
dEQP-VK.graphicsfuzz.cov-loop-condition-double-negate
+dEQP-VK.graphicsfuzz.cov-loop-condition-filter-some-iterations-never-discard
dEQP-VK.graphicsfuzz.cov-loop-condition-logical-or-never-iterated
dEQP-VK.graphicsfuzz.cov-loop-dfdx-constant-divide
dEQP-VK.graphicsfuzz.cov-loop-exit-conditions-sampler-struct-integer-variable
dEQP-VK.graphicsfuzz.cov-loop-divide-uninitialized-vector-min-unused
dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
dEQP-VK.graphicsfuzz.cov-loop-fragcoord-identical-condition
+dEQP-VK.graphicsfuzz.cov-loop-increase-iterator-condition-uniform-copy-array-elements
dEQP-VK.graphicsfuzz.cov-loop-increment-array-elements-clamp-index
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-findmsb-minus-uniform
dEQP-VK.graphicsfuzz.cov-loop-increment-integer-set-output-color-break
dEQP-VK.graphicsfuzz.cov-loop-increment-matrix-element-break-after-first-iteration
dEQP-VK.graphicsfuzz.cov-loop-increment-or-divide-by-loop-index
dEQP-VK.graphicsfuzz.cov-loop-integer-half-minus-one
+dEQP-VK.graphicsfuzz.cov-loop-iterator-plus-one-variable-outside-index-array
+dEQP-VK.graphicsfuzz.cov-loop-limiter-min-findlsb
+dEQP-VK.graphicsfuzz.cov-loop-limiter-uniform-bitwise-and-one-always-break
dEQP-VK.graphicsfuzz.cov-loop-logical-xor
+dEQP-VK.graphicsfuzz.cov-loop-replace-output-color-restore-original
dEQP-VK.graphicsfuzz.cov-loop-returns-behind-true-and-false
dEQP-VK.graphicsfuzz.cov-loop-set-vector-components-pow-two
dEQP-VK.graphicsfuzz.cov-loop-start-from-one-switch-case-invalid-color-never-executed
dEQP-VK.graphicsfuzz.cov-multiple-fragcoord-conditions-never-return-color-uninitialized
dEQP-VK.graphicsfuzz.cov-multiple-loops-same-condition-always-false-global-loop-counter
dEQP-VK.graphicsfuzz.cov-multiple-one-iteration-loops-global-counter-write-matrices
+dEQP-VK.graphicsfuzz.cov-negative-integer-bitwise-or-uniform-increment-loop
dEQP-VK.graphicsfuzz.cov-nested-functions-accumulate-global-matrix
dEQP-VK.graphicsfuzz.cov-nested-functions-compare-fragcood-length-zero-vector
dEQP-VK.graphicsfuzz.cov-nested-functions-loop-assign-global-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-not-greater-than-increment-array-element
dEQP-VK.graphicsfuzz.cov-nested-loop-undefined-smoothstep-never-executed
dEQP-VK.graphicsfuzz.cov-nested-loops-clamp-ivec-push-constant-increment-global-counter
+dEQP-VK.graphicsfuzz.cov-nested-loops-copy-array-elements-skip-first
dEQP-VK.graphicsfuzz.cov-nested-loops-different-iteration-rates-function-copy-array-elements
dEQP-VK.graphicsfuzz.cov-nested-loops-divide-integer-constant-always-zero
dEQP-VK.graphicsfuzz.cov-nested-loops-decrease-vector-component-by-matrix-element-global-loop-counter
dEQP-VK.graphicsfuzz.cov-nested-loops-float-array-select-by-fragcoord
dEQP-VK.graphicsfuzz.cov-nested-loops-float-bits-to-int-increment-array
+dEQP-VK.graphicsfuzz.cov-nested-loops-fragcoord-never-return-descending-loop
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-func-set-struct-field
dEQP-VK.graphicsfuzz.cov-nested-loops-global-counter-increment-single-element
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-do-while-accumulate-float
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-fragcoord-negative-always-false
dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-iterator-dependency
+dEQP-VK.graphicsfuzz.cov-nested-loops-global-loop-counter-output-color-from-backup
+dEQP-VK.graphicsfuzz.cov-nested-loops-identical-iterator-names-multiply-divide
dEQP-VK.graphicsfuzz.cov-nested-loops-increase-integer-dot-product
dEQP-VK.graphicsfuzz.cov-nested-loops-redundant-condition
dEQP-VK.graphicsfuzz.cov-nested-loops-sample-opposite-corners
dEQP-VK.graphicsfuzz.cov-texel-double-negation
dEQP-VK.graphicsfuzz.cov-transpose-multiply
dEQP-VK.graphicsfuzz.cov-trunc-fract-always-zero
+dEQP-VK.graphicsfuzz.cov-two-functions-modify-struct-array-element-return-from-loop
dEQP-VK.graphicsfuzz.cov-two-loops-global-loop-counter-shift-right-zero-increment-array-element
dEQP-VK.graphicsfuzz.cov-two-nested-loops-switch-case-matrix-array-increment
dEQP-VK.graphicsfuzz.cov-types-return-in-main-never-hit
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
dEQP-VK.graphicsfuzz.cov-value-tracking-uniform-incident
dEQP-VK.graphicsfuzz.cov-variable-copy-in-function-tex-sample
+dEQP-VK.graphicsfuzz.cov-vec2-dot-max-uniform
dEQP-VK.graphicsfuzz.cov-vec2-dot-minus-negative-zero
dEQP-VK.graphicsfuzz.cov-vec2-duplicate-min-always-half
dEQP-VK.graphicsfuzz.cov-vector-dce-inc-unused-comp