This commit adds a batch of GraphicsFuzz coverage tests.
Components: Vulkan
New Tests:
dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
dEQP-VK.graphicsfuzz.cov-inc-array-element-loop-lsb
dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-for-bitfieldinsert
dEQP-VK.graphicsfuzz.cov-inst-combine-compares-pre-increment-clamp
dEQP-VK.graphicsfuzz.cov-inst-combine-mul-div-rem-if-undefined-divide-mix
dEQP-VK.graphicsfuzz.cov-inst-combine-pack-unpack
dEQP-VK.graphicsfuzz.cov-inst-combine-select-findlsb-uaddcarry
dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-pack-unpack
dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-packsnorm-unpackunorm
dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-switch-or-xor
dEQP-VK.graphicsfuzz.cov-inst-combine-vector-ops-asin
dEQP-VK.graphicsfuzz.cov-integer-modulo-negative
dEQP-VK.graphicsfuzz.cov-machine-basic-block-for-for-for-less-than
dEQP-VK.graphicsfuzz.cov-mod-acosh
dEQP-VK.graphicsfuzz.cov-modf-clamp-for
dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
dEQP-VK.graphicsfuzz.cov-return-after-do-while
dEQP-VK.graphicsfuzz.cov-schedule-dag-rrlist-mix-log-cos
dEQP-VK.graphicsfuzz.cov-selection-dag-inverse-clamp
dEQP-VK.graphicsfuzz.cov-simplify-combine-compares-max-max-one
dEQP-VK.graphicsfuzz.cov-simplify-max-multiplied-values
dEQP-VK.graphicsfuzz.cov-simplify-modulo-1
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-apfloat-nan-cos-cos
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-negative-left-shift
Change-Id: I828213b28022beefd52327e25ee9339272ec9746
dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
dEQP-VK.graphicsfuzz.cov-apfloat-tanh
dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
+dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
+dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
+dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
+dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
dEQP-VK.graphicsfuzz.cov-const-folding-clamp
dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
+dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
dEQP-VK.graphicsfuzz.cov-fold-and-in-for-loop-range
dEQP-VK.graphicsfuzz.cov-fold-bitwise-and-zero
dEQP-VK.graphicsfuzz.cov-fold-bitwise-or-full-mask
dEQP-VK.graphicsfuzz.cov-folding-rules-split-vector-init
dEQP-VK.graphicsfuzz.cov-folding-rules-vec-mix-uniform
dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
+dEQP-VK.graphicsfuzz.cov-inc-array-element-loop-lsb
dEQP-VK.graphicsfuzz.cov-inc-inside-switch-and-for
dEQP-VK.graphicsfuzz.cov-increment-inside-clamp
dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-for-bitfieldinsert
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-pre-increment-clamp
+dEQP-VK.graphicsfuzz.cov-inst-combine-mul-div-rem-if-undefined-divide-mix
+dEQP-VK.graphicsfuzz.cov-inst-combine-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-select-findlsb-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-packsnorm-unpackunorm
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-switch-or-xor
+dEQP-VK.graphicsfuzz.cov-inst-combine-vector-ops-asin
+dEQP-VK.graphicsfuzz.cov-integer-modulo-negative
dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
+dEQP-VK.graphicsfuzz.cov-machine-basic-block-for-for-for-less-than
dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
+dEQP-VK.graphicsfuzz.cov-mod-acosh
+dEQP-VK.graphicsfuzz.cov-modf-clamp-for
dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
dEQP-VK.graphicsfuzz.cov-optimize-phis-for
dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
+dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
dEQP-VK.graphicsfuzz.cov-pattern-match-signum
dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
dEQP-VK.graphicsfuzz.cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
dEQP-VK.graphicsfuzz.cov-replace-copy-object
+dEQP-VK.graphicsfuzz.cov-return-after-do-while
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops-array-access
+dEQP-VK.graphicsfuzz.cov-schedule-dag-rrlist-mix-log-cos
+dEQP-VK.graphicsfuzz.cov-selection-dag-inverse-clamp
dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
+dEQP-VK.graphicsfuzz.cov-simplify-combine-compares-max-max-one
dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
+dEQP-VK.graphicsfuzz.cov-simplify-max-multiplied-values
+dEQP-VK.graphicsfuzz.cov-simplify-modulo-1
dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-apfloat-nan-cos-cos
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-negative-left-shift
dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
dEQP-VK.graphicsfuzz.dead-barriers-in-loops
dEQP-VK.graphicsfuzz.dead-struct-init
dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
dEQP-VK.graphicsfuzz.cov-apfloat-tanh
dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
+dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
+dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
+dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
+dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
dEQP-VK.graphicsfuzz.cov-const-folding-clamp
dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
+dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
dEQP-VK.graphicsfuzz.cov-fold-and-in-for-loop-range
dEQP-VK.graphicsfuzz.cov-fold-bitwise-and-zero
dEQP-VK.graphicsfuzz.cov-fold-bitwise-or-full-mask
dEQP-VK.graphicsfuzz.cov-folding-rules-split-vector-init
dEQP-VK.graphicsfuzz.cov-folding-rules-vec-mix-uniform
dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
+dEQP-VK.graphicsfuzz.cov-inc-array-element-loop-lsb
dEQP-VK.graphicsfuzz.cov-inc-inside-switch-and-for
dEQP-VK.graphicsfuzz.cov-increment-inside-clamp
dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-for-bitfieldinsert
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-pre-increment-clamp
+dEQP-VK.graphicsfuzz.cov-inst-combine-mul-div-rem-if-undefined-divide-mix
+dEQP-VK.graphicsfuzz.cov-inst-combine-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-select-findlsb-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-packsnorm-unpackunorm
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-switch-or-xor
+dEQP-VK.graphicsfuzz.cov-inst-combine-vector-ops-asin
+dEQP-VK.graphicsfuzz.cov-integer-modulo-negative
dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
+dEQP-VK.graphicsfuzz.cov-machine-basic-block-for-for-for-less-than
dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
+dEQP-VK.graphicsfuzz.cov-mod-acosh
+dEQP-VK.graphicsfuzz.cov-modf-clamp-for
dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
dEQP-VK.graphicsfuzz.cov-optimize-phis-for
dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
+dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
dEQP-VK.graphicsfuzz.cov-pattern-match-signum
dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
dEQP-VK.graphicsfuzz.cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
dEQP-VK.graphicsfuzz.cov-replace-copy-object
+dEQP-VK.graphicsfuzz.cov-return-after-do-while
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops-array-access
+dEQP-VK.graphicsfuzz.cov-schedule-dag-rrlist-mix-log-cos
+dEQP-VK.graphicsfuzz.cov-selection-dag-inverse-clamp
dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
+dEQP-VK.graphicsfuzz.cov-simplify-combine-compares-max-max-one
dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
+dEQP-VK.graphicsfuzz.cov-simplify-max-multiplied-values
+dEQP-VK.graphicsfuzz.cov-simplify-modulo-1
dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-apfloat-nan-cos-cos
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-negative-left-shift
dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
dEQP-VK.graphicsfuzz.dead-barriers-in-loops
dEQP-VK.graphicsfuzz.dead-struct-init
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific APFloat code path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_100 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_9993001 _GLF_uniform_int_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 100, 1, 9993001]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // Becomes -9993001.
+# float a = determinant(mat3(1.0, 5000.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2000.0));
+#
+# int b = _int_1;
+#
+# for (int i = _int_1; i < _int_100; i++)
+# {
+# if (b > _int_1)
+# {
+# break;
+# }
+# b = int(a);
+# }
+#
+# if (b == -_int_9993001)
+# {
+# _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: 87
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %68
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %21 "b"
+ OpName %25 "buf0"
+ OpMemberName %25 0 "_GLF_uniform_int_values"
+ OpName %27 ""
+ OpName %33 "i"
+ OpName %68 "_GLF_color"
+ OpDecorate %24 ArrayStride 16
+ OpMemberDecorate %25 0 Offset 0
+ OpDecorate %25 Block
+ OpDecorate %27 DescriptorSet 0
+ OpDecorate %27 Binding 0
+ OpDecorate %68 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeVector %6 3
+ %10 = OpTypeMatrix %9 3
+ %11 = OpConstant %6 1
+ %12 = OpConstant %6 5000
+ %13 = OpConstantComposite %9 %11 %12 %11
+ %14 = OpConstantComposite %9 %11 %11 %11
+ %15 = OpConstant %6 2000
+ %16 = OpConstantComposite %9 %11 %11 %15
+ %17 = OpConstantComposite %10 %13 %14 %16
+ %19 = OpTypeInt 32 1
+ %20 = OpTypePointer Function %19
+ %22 = OpTypeInt 32 0
+ %23 = OpConstant %22 4
+ %24 = OpTypeArray %19 %23
+ %25 = OpTypeStruct %24
+ %26 = OpTypePointer Uniform %25
+ %27 = OpVariable %26 Uniform
+ %28 = OpConstant %19 0
+ %29 = OpConstant %19 2
+ %30 = OpTypePointer Uniform %19
+ %42 = OpConstant %19 1
+ %45 = OpTypeBool
+ %59 = OpConstant %19 3
+ %66 = OpTypeVector %6 4
+ %67 = OpTypePointer Output %66
+ %68 = OpVariable %67 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %21 = OpVariable %20 Function
+ %33 = OpVariable %20 Function
+ %18 = OpExtInst %6 %1 Determinant %17
+ OpStore %8 %18
+ %31 = OpAccessChain %30 %27 %28 %29
+ %32 = OpLoad %19 %31
+ OpStore %21 %32
+ %34 = OpAccessChain %30 %27 %28 %29
+ %35 = OpLoad %19 %34
+ OpStore %33 %35
+ OpBranch %36
+ %36 = OpLabel
+ OpLoopMerge %38 %39 None
+ OpBranch %40
+ %40 = OpLabel
+ %41 = OpLoad %19 %33
+ %43 = OpAccessChain %30 %27 %28 %42
+ %44 = OpLoad %19 %43
+ %46 = OpSLessThan %45 %41 %44
+ OpBranchConditional %46 %37 %38
+ %37 = OpLabel
+ %47 = OpLoad %19 %21
+ %48 = OpAccessChain %30 %27 %28 %29
+ %49 = OpLoad %19 %48
+ %50 = OpSGreaterThan %45 %47 %49
+ OpSelectionMerge %52 None
+ OpBranchConditional %50 %51 %52
+ %51 = OpLabel
+ OpBranch %38
+ %52 = OpLabel
+ %54 = OpLoad %6 %8
+ %55 = OpConvertFToS %19 %54
+ OpStore %21 %55
+ OpBranch %39
+ %39 = OpLabel
+ %56 = OpLoad %19 %33
+ %57 = OpIAdd %19 %56 %42
+ OpStore %33 %57
+ OpBranch %36
+ %38 = OpLabel
+ %58 = OpLoad %19 %21
+ %60 = OpAccessChain %30 %27 %28 %59
+ %61 = OpLoad %19 %60
+ %62 = OpSNegate %19 %61
+ %63 = OpIEqual %45 %58 %62
+ OpSelectionMerge %65 None
+ OpBranchConditional %63 %64 %82
+ %64 = OpLabel
+ %69 = OpAccessChain %30 %27 %28 %29
+ %70 = OpLoad %19 %69
+ %71 = OpConvertSToF %6 %70
+ %72 = OpAccessChain %30 %27 %28 %28
+ %73 = OpLoad %19 %72
+ %74 = OpConvertSToF %6 %73
+ %75 = OpAccessChain %30 %27 %28 %28
+ %76 = OpLoad %19 %75
+ %77 = OpConvertSToF %6 %76
+ %78 = OpAccessChain %30 %27 %28 %29
+ %79 = OpLoad %19 %78
+ %80 = OpConvertSToF %6 %79
+ %81 = OpCompositeConstruct %66 %71 %74 %77 %80
+ OpStore %68 %81
+ OpBranch %65
+ %82 = OpLabel
+ %83 = OpAccessChain %30 %27 %28 %28
+ %84 = OpLoad %19 %83
+ %85 = OpConvertSToF %6 %84
+ %86 = OpCompositeConstruct %66 %85 %85 %85 %85
+ OpStore %68 %86
+ OpBranch %65
+ %65 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 100 1 9993001
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific floating point code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_768 _GLF_uniform_int_values[2]
+# #define _int_1792 _GLF_uniform_int_values[3]
+# #define _int_45056 _GLF_uniform_int_values[4]
+# #define _float_0_1 _GLF_uniform_float_values[0]
+# #define _float_0_5 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 768, 1792, 45056]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[5];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.1, 0.5, 2.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // All components of I are denormalized.
+# vec4 I = uintBitsToFloat(uvec4(_int_768, _int_1792, _int_45056, 0x16b39));
+# vec4 N = vec4(_float_0_5);
+#
+# // Whether or not denormalized values are supported or flushed to zero,
+# // the result of "reflect" should match the reference result.
+# vec4 R = reflect(I, vec4(0.5));
+# vec4 ref = I - _float_2_0 * dot(N, I) * N;
+#
+# if (distance(R, ref) < _float_0_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; 8
+; Bound: 91
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %72
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "I"
+ OpName %14 "buf0"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpName %35 "N"
+ OpName %38 "buf1"
+ OpMemberName %38 0 "_GLF_uniform_float_values"
+ OpName %40 ""
+ OpName %46 "R"
+ OpName %51 "ref"
+ OpName %72 "_GLF_color"
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 0
+ OpDecorate %37 ArrayStride 16
+ OpMemberDecorate %38 0 Offset 0
+ OpDecorate %38 Block
+ OpDecorate %40 DescriptorSet 0
+ OpDecorate %40 Binding 1
+ OpDecorate %72 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypePointer Function %7
+ %10 = OpTypeInt 32 1
+ %11 = OpTypeInt 32 0
+ %12 = OpConstant %11 5
+ %13 = OpTypeArray %10 %12
+ %14 = OpTypeStruct %13
+ %15 = OpTypePointer Uniform %14
+ %16 = OpVariable %15 Uniform
+ %17 = OpConstant %10 0
+ %18 = OpConstant %10 2
+ %19 = OpTypePointer Uniform %10
+ %23 = OpConstant %10 3
+ %27 = OpConstant %10 4
+ %31 = OpConstant %11 92985
+ %32 = OpTypeVector %11 4
+ %36 = OpConstant %11 3
+ %37 = OpTypeArray %6 %36
+ %38 = OpTypeStruct %37
+ %39 = OpTypePointer Uniform %38
+ %40 = OpVariable %39 Uniform
+ %41 = OpConstant %10 1
+ %42 = OpTypePointer Uniform %6
+ %48 = OpConstant %6 0.5
+ %49 = OpConstantComposite %7 %48 %48 %48 %48
+ %67 = OpTypeBool
+ %71 = OpTypePointer Output %7
+ %72 = OpVariable %71 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %35 = OpVariable %8 Function
+ %46 = OpVariable %8 Function
+ %51 = OpVariable %8 Function
+ %20 = OpAccessChain %19 %16 %17 %18
+ %21 = OpLoad %10 %20
+ %22 = OpBitcast %11 %21
+ %24 = OpAccessChain %19 %16 %17 %23
+ %25 = OpLoad %10 %24
+ %26 = OpBitcast %11 %25
+ %28 = OpAccessChain %19 %16 %17 %27
+ %29 = OpLoad %10 %28
+ %30 = OpBitcast %11 %29
+ %33 = OpCompositeConstruct %32 %22 %26 %30 %31
+ %34 = OpBitcast %7 %33
+ OpStore %9 %34
+ %43 = OpAccessChain %42 %40 %17 %41
+ %44 = OpLoad %6 %43
+ %45 = OpCompositeConstruct %7 %44 %44 %44 %44
+ OpStore %35 %45
+ %47 = OpLoad %7 %9
+ %50 = OpExtInst %7 %1 Reflect %47 %49
+ OpStore %46 %50
+ %52 = OpLoad %7 %9
+ %53 = OpAccessChain %42 %40 %17 %18
+ %54 = OpLoad %6 %53
+ %55 = OpLoad %7 %35
+ %56 = OpLoad %7 %9
+ %57 = OpDot %6 %55 %56
+ %58 = OpFMul %6 %54 %57
+ %59 = OpLoad %7 %35
+ %60 = OpVectorTimesScalar %7 %59 %58
+ %61 = OpFSub %7 %52 %60
+ OpStore %51 %61
+ %62 = OpLoad %7 %46
+ %63 = OpLoad %7 %51
+ %64 = OpExtInst %6 %1 Distance %62 %63
+ %65 = OpAccessChain %42 %40 %17 %17
+ %66 = OpLoad %6 %65
+ %68 = OpFOrdLessThan %67 %64 %66
+ OpSelectionMerge %70 None
+ OpBranchConditional %68 %69 %86
+ %69 = OpLabel
+ %73 = OpAccessChain %19 %16 %17 %17
+ %74 = OpLoad %10 %73
+ %75 = OpConvertSToF %6 %74
+ %76 = OpAccessChain %19 %16 %17 %41
+ %77 = OpLoad %10 %76
+ %78 = OpConvertSToF %6 %77
+ %79 = OpAccessChain %19 %16 %17 %41
+ %80 = OpLoad %10 %79
+ %81 = OpConvertSToF %6 %80
+ %82 = OpAccessChain %19 %16 %17 %17
+ %83 = OpLoad %10 %82
+ %84 = OpConvertSToF %6 %83
+ %85 = OpCompositeConstruct %7 %75 %78 %81 %84
+ OpStore %72 %85
+ OpBranch %70
+ %86 = OpLabel
+ %87 = OpAccessChain %19 %16 %17 %41
+ %88 = OpLoad %10 %87
+ %89 = OpConvertSToF %6 %88
+ %90 = OpCompositeConstruct %7 %89 %89 %89 %89
+ OpStore %72 %90
+ OpBranch %70
+ %70 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.1 0.5 2.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 768 1792 45056
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific floating point code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_5 _GLF_uniform_int_values[2]
+#
+# 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[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# for (int i = _int_0; i < _int_5; i++)
+# {
+# vec4 v = unpackUnorm4x8(100u);
+#
+# // Always false.
+# if (int(v.x) > i)
+# {
+# _GLF_color = vec4(_int_0);
+# return;
+# }
+# }
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 68
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %47
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %34 "v"
+ OpName %47 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %47 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 = OpConstant %6 2
+ %29 = OpTypeBool
+ %31 = OpTypeFloat 32
+ %32 = OpTypeVector %31 4
+ %33 = OpTypePointer Function %32
+ %35 = OpConstant %9 100
+ %37 = OpConstant %9 0
+ %38 = OpTypePointer Function %31
+ %46 = OpTypePointer Output %32
+ %47 = OpVariable %46 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %34 = OpVariable %33 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
+ %27 = OpAccessChain %17 %14 %15 %26
+ %28 = OpLoad %6 %27
+ %30 = OpSLessThan %29 %25 %28
+ OpBranchConditional %30 %21 %22
+ %21 = OpLabel
+ %36 = OpExtInst %32 %1 UnpackUnorm4x8 %35
+ OpStore %34 %36
+ %39 = OpAccessChain %38 %34 %37
+ %40 = OpLoad %31 %39
+ %41 = OpConvertFToS %6 %40
+ %42 = OpLoad %6 %8
+ %43 = OpSGreaterThan %29 %41 %42
+ OpSelectionMerge %45 None
+ OpBranchConditional %43 %44 %45
+ %44 = OpLabel
+ %48 = OpAccessChain %17 %14 %15 %16
+ %49 = OpLoad %6 %48
+ %50 = OpConvertSToF %31 %49
+ %51 = OpCompositeConstruct %32 %50 %50 %50 %50
+ OpStore %47 %51
+ OpReturn
+ %45 = OpLabel
+ OpBranch %23
+ %23 = OpLabel
+ %53 = OpLoad %6 %8
+ %54 = OpIAdd %6 %53 %16
+ OpStore %8 %54
+ OpBranch %20
+ %22 = OpLabel
+ %55 = OpAccessChain %17 %14 %15 %15
+ %56 = OpLoad %6 %55
+ %57 = OpConvertSToF %31 %56
+ %58 = OpAccessChain %17 %14 %15 %16
+ %59 = OpLoad %6 %58
+ %60 = OpConvertSToF %31 %59
+ %61 = OpAccessChain %17 %14 %15 %16
+ %62 = OpLoad %6 %61
+ %63 = OpConvertSToF %31 %62
+ %64 = OpAccessChain %17 %14 %15 %15
+ %65 = OpLoad %6 %64
+ %66 = OpConvertSToF %31 %65
+ %67 = OpCompositeConstruct %32 %57 %60 %63 %66
+ OpStore %47 %67
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 5
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific DAG code paths
+
+# The test passes because the shader always writes red.
+
+# Optimized using spirv-opt with the following arguments:
+# '-O'
+# spirv-opt commit hash: a187dd58a0485988841d325a85c8e6063f53500a
+
+
+
+SHADER vertex variant_vertex_shader PASSTHROUGH
+
+# variant_fragment_shader is derived from the following GLSL:
+# #version 310 es
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_0_1 _GLF_uniform_float_values[2]
+# #define _float_0_3 _GLF_uniform_float_values[3]
+# #define _float_0_2 _GLF_uniform_float_values[4]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0, 0.1, 0.3, 0.2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // These conditions don't matter since the color
+# // gets overwritten right after.
+# if(gl_FragCoord.x > _float_1_0)
+# {
+# _GLF_color = vec4(_float_0_1);
+# if(gl_FragCoord.y > _float_1_0)
+# {
+# _GLF_color = vec4(_float_0_2);
+# }
+# _GLF_color = vec4(_float_0_3);
+# }
+#
+# _GLF_color = vec4(_float_1_0, _float_0_0, _float_0_0, 10.0);
+# // Multiplying by an identity matrix doesn't change the vector value.
+# _GLF_color = mat4(_float_1_0) * _GLF_color;
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 72
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9 %30
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "gl_FragCoord"
+ OpName %17 "buf0"
+ OpMemberName %17 0 "_GLF_uniform_float_values"
+ OpName %19 ""
+ OpName %30 "_GLF_color"
+ OpDecorate %9 BuiltIn FragCoord
+ OpDecorate %16 ArrayStride 16
+ OpMemberDecorate %17 0 Offset 0
+ OpDecorate %17 Block
+ OpDecorate %19 DescriptorSet 0
+ OpDecorate %19 Binding 0
+ OpDecorate %30 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypePointer Input %7
+ %9 = OpVariable %8 Input
+ %10 = OpTypeInt 32 0
+ %11 = OpConstant %10 0
+ %12 = OpTypePointer Input %6
+ %15 = OpConstant %10 5
+ %16 = OpTypeArray %6 %15
+ %17 = OpTypeStruct %16
+ %18 = OpTypePointer Uniform %17
+ %19 = OpVariable %18 Uniform
+ %20 = OpTypeInt 32 1
+ %21 = OpConstant %20 0
+ %22 = OpTypePointer Uniform %6
+ %25 = OpTypeBool
+ %29 = OpTypePointer Output %7
+ %30 = OpVariable %29 Output
+ %31 = OpConstant %20 2
+ %35 = OpConstant %10 1
+ %43 = OpConstant %20 4
+ %47 = OpConstant %20 3
+ %53 = OpConstant %20 1
+ %58 = OpConstant %6 10
+ %62 = OpTypeMatrix %7 4
+ %64 = OpConstant %6 0
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %13 = OpAccessChain %12 %9 %11
+ %14 = OpLoad %6 %13
+ %23 = OpAccessChain %22 %19 %21 %21
+ %24 = OpLoad %6 %23
+ %26 = OpFOrdGreaterThan %25 %14 %24
+ OpSelectionMerge %28 None
+ OpBranchConditional %26 %27 %28
+ %27 = OpLabel
+ %32 = OpAccessChain %22 %19 %21 %31
+ %33 = OpLoad %6 %32
+ %34 = OpCompositeConstruct %7 %33 %33 %33 %33
+ OpStore %30 %34
+ %36 = OpAccessChain %12 %9 %35
+ %37 = OpLoad %6 %36
+ %40 = OpFOrdGreaterThan %25 %37 %24
+ OpSelectionMerge %42 None
+ OpBranchConditional %40 %41 %42
+ %41 = OpLabel
+ %44 = OpAccessChain %22 %19 %21 %43
+ %45 = OpLoad %6 %44
+ %46 = OpCompositeConstruct %7 %45 %45 %45 %45
+ OpStore %30 %46
+ OpBranch %42
+ %42 = OpLabel
+ %48 = OpAccessChain %22 %19 %21 %47
+ %49 = OpLoad %6 %48
+ %50 = OpCompositeConstruct %7 %49 %49 %49 %49
+ OpStore %30 %50
+ OpBranch %28
+ %28 = OpLabel
+ %54 = OpAccessChain %22 %19 %21 %53
+ %55 = OpLoad %6 %54
+ %59 = OpCompositeConstruct %7 %24 %55 %55 %58
+ OpStore %30 %59
+ %65 = OpCompositeConstruct %7 %24 %64 %64 %64
+ %66 = OpCompositeConstruct %7 %64 %24 %64 %64
+ %67 = OpCompositeConstruct %7 %64 %64 %24 %64
+ %68 = OpCompositeConstruct %7 %64 %64 %64 %24
+ %69 = OpCompositeConstruct %62 %65 %66 %67 %68
+ %70 = OpLoad %7 %30
+ %71 = OpMatrixTimesVector %7 %69 %70
+ OpStore %30 %71
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.0 0.1 0.3 0.2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific instruction simplify code path
+
+# 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 310 es
+# #define _int_5 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_0 _GLF_uniform_int_values[3]
+# #define _int_9 _GLF_uniform_int_values[4]
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [5, 2, 1, 0, 9]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# struct S {
+# int data;
+# };
+#
+# void main()
+# {
+# int value = -_int_1;
+# for (int i = _int_1; i < _int_5; i++)
+# {
+# // idx becomes undefined during the first and third iteration since i
+# // is divided by zero. Nevertheless, it becomes 2 in the last iteration.
+# int idx = clamp(_int_0, (i / findLSB(i)), _int_9);
+#
+# if (idx == _int_2)
+# {
+# value = S[3](S(_int_0), S(_int_1), S(_int_2))[idx].data;
+# }
+# }
+#
+# if (value == _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 310
+ OpName %4 "main"
+ OpName %8 "value"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %21 "i"
+ OpName %34 "idx"
+ OpName %55 "S"
+ OpMemberName %55 0 "data"
+ OpName %68 "indexable"
+ 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 5
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpConstant %6 2
+ %17 = OpTypePointer Uniform %6
+ %32 = OpTypeBool
+ %35 = OpConstant %6 3
+ %42 = OpConstant %6 4
+ %47 = OpConstant %6 1
+ %55 = OpTypeStruct %6
+ %63 = OpConstant %9 3
+ %64 = OpTypeArray %55 %63
+ %67 = OpTypePointer Function %64
+ %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
+ %21 = OpVariable %7 Function
+ %34 = OpVariable %7 Function
+ %68 = OpVariable %67 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ %20 = OpSNegate %6 %19
+ OpStore %8 %20
+ %22 = OpAccessChain %17 %14 %15 %16
+ %23 = OpLoad %6 %22
+ OpStore %21 %23
+ OpBranch %24
+ %24 = OpLabel
+ OpLoopMerge %26 %27 None
+ OpBranch %28
+ %28 = OpLabel
+ %29 = OpLoad %6 %21
+ %30 = OpAccessChain %17 %14 %15 %15
+ %31 = OpLoad %6 %30
+ %33 = OpSLessThan %32 %29 %31
+ OpBranchConditional %33 %25 %26
+ %25 = OpLabel
+ %36 = OpAccessChain %17 %14 %15 %35
+ %37 = OpLoad %6 %36
+ %38 = OpLoad %6 %21
+ %39 = OpLoad %6 %21
+ %40 = OpExtInst %6 %1 FindILsb %39
+ %41 = OpSDiv %6 %38 %40
+ %43 = OpAccessChain %17 %14 %15 %42
+ %44 = OpLoad %6 %43
+ %45 = OpExtInst %6 %1 SClamp %37 %41 %44
+ OpStore %34 %45
+ %46 = OpLoad %6 %34
+ %48 = OpAccessChain %17 %14 %15 %47
+ %49 = OpLoad %6 %48
+ %50 = OpIEqual %32 %46 %49
+ OpSelectionMerge %52 None
+ OpBranchConditional %50 %51 %52
+ %51 = OpLabel
+ %53 = OpAccessChain %17 %14 %15 %35
+ %54 = OpLoad %6 %53
+ %56 = OpCompositeConstruct %55 %54
+ %57 = OpAccessChain %17 %14 %15 %16
+ %58 = OpLoad %6 %57
+ %59 = OpCompositeConstruct %55 %58
+ %60 = OpAccessChain %17 %14 %15 %47
+ %61 = OpLoad %6 %60
+ %62 = OpCompositeConstruct %55 %61
+ %65 = OpCompositeConstruct %64 %56 %59 %62
+ %66 = OpLoad %6 %34
+ OpStore %68 %65
+ %69 = OpAccessChain %7 %68 %66 %15
+ %70 = OpLoad %6 %69
+ OpStore %8 %70
+ OpBranch %52
+ %52 = OpLabel
+ OpBranch %27
+ %27 = OpLabel
+ %71 = OpLoad %6 %21
+ %72 = OpIAdd %6 %71 %47
+ OpStore %21 %72
+ OpBranch %24
+ %26 = OpLabel
+ %73 = OpLoad %6 %8
+ %74 = OpAccessChain %17 %14 %15 %47
+ %75 = OpLoad %6 %74
+ %76 = OpIEqual %32 %73 %75
+ OpSelectionMerge %78 None
+ OpBranchConditional %76 %77 %96
+ %77 = OpLabel
+ %83 = OpAccessChain %17 %14 %15 %16
+ %84 = OpLoad %6 %83
+ %85 = OpConvertSToF %79 %84
+ %86 = OpAccessChain %17 %14 %15 %35
+ %87 = OpLoad %6 %86
+ %88 = OpConvertSToF %79 %87
+ %89 = OpAccessChain %17 %14 %15 %35
+ %90 = OpLoad %6 %89
+ %91 = OpConvertSToF %79 %90
+ %92 = OpAccessChain %17 %14 %15 %16
+ %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 %35
+ %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
+ 5 2 1 0 9
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific SSCP path
+
+# 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 310 es
+# #define _int_50 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_49 _GLF_uniform_int_values[3]
+# #define _float_2_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [2.0, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [50, 0, 1, 49]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float A[50];
+# int i = _int_0;
+#
+# // Initializes all A elements to 1.0 and leaves i at 49.
+# for( i = _int_0; i < _int_50; i ++)
+# A[i] = _float_1_0;
+#
+# // a becomes 0.
+# int a = findLSB(0);
+#
+# // Loops once.
+# do
+# {
+# i ++;
+# A[clamp(a, _int_0, _int_49)] += _float_1_0;
+# }
+# while(a < _int_1 && i < _int_50);
+#
+# // Always true.
+# if(A[_int_0] == _float_2_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_0);
+# return;
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 114
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %94
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ OpName %12 "buf1"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %36 "A"
+ OpName %40 "buf0"
+ OpMemberName %40 0 "_GLF_uniform_float_values"
+ OpName %42 ""
+ OpName %50 "a"
+ OpName %94 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 1
+ OpDecorate %39 ArrayStride 16
+ OpMemberDecorate %40 0 Offset 0
+ OpDecorate %40 Block
+ OpDecorate %42 DescriptorSet 0
+ OpDecorate %42 Binding 0
+ OpDecorate %51 RelaxedPrecision
+ OpDecorate %94 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 1
+ %17 = OpTypePointer Uniform %6
+ %30 = OpTypeBool
+ %32 = OpTypeFloat 32
+ %33 = OpConstant %9 50
+ %34 = OpTypeArray %32 %33
+ %35 = OpTypePointer Function %34
+ %38 = OpConstant %9 2
+ %39 = OpTypeArray %32 %38
+ %40 = OpTypeStruct %39
+ %41 = OpTypePointer Uniform %40
+ %42 = OpVariable %41 Uniform
+ %43 = OpTypePointer Uniform %32
+ %46 = OpTypePointer Function %32
+ %61 = OpConstant %6 3
+ %72 = OpConstant %6 2
+ %92 = OpTypeVector %32 4
+ %93 = OpTypePointer Output %92
+ %94 = OpVariable %93 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %36 = OpVariable %35 Function
+ %50 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %15 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ %20 = OpAccessChain %17 %14 %15 %16
+ %21 = OpLoad %6 %20
+ OpStore %8 %21
+ OpBranch %22
+ %22 = OpLabel
+ OpLoopMerge %24 %25 None
+ OpBranch %26
+ %26 = OpLabel
+ %27 = OpLoad %6 %8
+ %28 = OpAccessChain %17 %14 %15 %15
+ %29 = OpLoad %6 %28
+ %31 = OpSLessThan %30 %27 %29
+ OpBranchConditional %31 %23 %24
+ %23 = OpLabel
+ %37 = OpLoad %6 %8
+ %44 = OpAccessChain %43 %42 %15 %16
+ %45 = OpLoad %32 %44
+ %47 = OpAccessChain %46 %36 %37
+ OpStore %47 %45
+ OpBranch %25
+ %25 = OpLabel
+ %48 = OpLoad %6 %8
+ %49 = OpIAdd %6 %48 %16
+ OpStore %8 %49
+ OpBranch %22
+ %24 = OpLabel
+ %51 = OpExtInst %6 %1 FindILsb %15
+ OpStore %50 %51
+ OpBranch %52
+ %52 = OpLabel
+ OpLoopMerge %54 %55 None
+ OpBranch %53
+ %53 = OpLabel
+ %56 = OpLoad %6 %8
+ %57 = OpIAdd %6 %56 %16
+ OpStore %8 %57
+ %58 = OpLoad %6 %50
+ %59 = OpAccessChain %17 %14 %15 %16
+ %60 = OpLoad %6 %59
+ %62 = OpAccessChain %17 %14 %15 %61
+ %63 = OpLoad %6 %62
+ %64 = OpExtInst %6 %1 SClamp %58 %60 %63
+ %65 = OpAccessChain %43 %42 %15 %16
+ %66 = OpLoad %32 %65
+ %67 = OpAccessChain %46 %36 %64
+ %68 = OpLoad %32 %67
+ %69 = OpFAdd %32 %68 %66
+ %70 = OpAccessChain %46 %36 %64
+ OpStore %70 %69
+ OpBranch %55
+ %55 = OpLabel
+ %71 = OpLoad %6 %50
+ %73 = OpAccessChain %17 %14 %15 %72
+ %74 = OpLoad %6 %73
+ %75 = OpSLessThan %30 %71 %74
+ OpSelectionMerge %77 None
+ OpBranchConditional %75 %76 %77
+ %76 = OpLabel
+ %78 = OpLoad %6 %8
+ %79 = OpAccessChain %17 %14 %15 %15
+ %80 = OpLoad %6 %79
+ %81 = OpSLessThan %30 %78 %80
+ OpBranch %77
+ %77 = OpLabel
+ %82 = OpPhi %30 %75 %55 %81 %76
+ OpBranchConditional %82 %52 %54
+ %54 = OpLabel
+ %83 = OpAccessChain %17 %14 %15 %16
+ %84 = OpLoad %6 %83
+ %85 = OpAccessChain %46 %36 %84
+ %86 = OpLoad %32 %85
+ %87 = OpAccessChain %43 %42 %15 %15
+ %88 = OpLoad %32 %87
+ %89 = OpFOrdEqual %30 %86 %88
+ OpSelectionMerge %91 None
+ OpBranchConditional %89 %90 %108
+ %90 = OpLabel
+ %95 = OpAccessChain %17 %14 %15 %72
+ %96 = OpLoad %6 %95
+ %97 = OpConvertSToF %32 %96
+ %98 = OpAccessChain %17 %14 %15 %16
+ %99 = OpLoad %6 %98
+ %100 = OpConvertSToF %32 %99
+ %101 = OpAccessChain %17 %14 %15 %16
+ %102 = OpLoad %6 %101
+ %103 = OpConvertSToF %32 %102
+ %104 = OpAccessChain %17 %14 %15 %72
+ %105 = OpLoad %6 %104
+ %106 = OpConvertSToF %32 %105
+ %107 = OpCompositeConstruct %92 %97 %100 %103 %106
+ OpStore %94 %107
+ OpBranch %91
+ %108 = OpLabel
+ %109 = OpAccessChain %17 %14 %15 %16
+ %110 = OpLoad %6 %109
+ %111 = OpConvertSToF %32 %110
+ %112 = OpCompositeConstruct %92 %111 %111 %111 %111
+ OpStore %94 %112
+ OpReturn
+ %91 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 50 0 1 49
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 2.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific inst combine and or xor code path
+
+# 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 310 es
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int a = 1;
+#
+# for (int i = 0; i < 2; i++)
+# {
+# a = bitfieldInsert(1, 1, 1, i);
+# }
+#
+# if (a == 3) {
+# _GLF_color = vec4(1, 0, 0, 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: 39
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %33
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %10 "i"
+ OpName %33 "_GLF_color"
+ OpDecorate %33 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpConstant %6 1
+ %11 = OpConstant %6 0
+ %18 = OpConstant %6 2
+ %19 = OpTypeBool
+ %26 = OpConstant %6 3
+ %30 = OpTypeFloat 32
+ %31 = OpTypeVector %30 4
+ %32 = OpTypePointer Output %31
+ %33 = OpVariable %32 Output
+ %34 = OpConstant %30 1
+ %35 = OpConstant %30 0
+ %36 = OpConstantComposite %31 %34 %35 %35 %34
+ %38 = OpConstantComposite %31 %35 %35 %35 %35
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %10 = OpVariable %7 Function
+ OpStore %8 %9
+ OpStore %10 %11
+ OpBranch %12
+ %12 = OpLabel
+ OpLoopMerge %14 %15 None
+ OpBranch %16
+ %16 = OpLabel
+ %17 = OpLoad %6 %10
+ %20 = OpSLessThan %19 %17 %18
+ OpBranchConditional %20 %13 %14
+ %13 = OpLabel
+ %21 = OpLoad %6 %10
+ %22 = OpBitFieldInsert %6 %9 %9 %9 %21
+ OpStore %8 %22
+ OpBranch %15
+ %15 = OpLabel
+ %23 = OpLoad %6 %10
+ %24 = OpIAdd %6 %23 %9
+ OpStore %10 %24
+ OpBranch %12
+ %14 = OpLabel
+ %25 = OpLoad %6 %8
+ %27 = OpIEqual %19 %25 %26
+ OpSelectionMerge %29 None
+ OpBranchConditional %27 %28 %37
+ %28 = OpLabel
+ OpStore %33 %36
+ OpBranch %29
+ %37 = OpLabel
+ OpStore %33 %38
+ OpBranch %29
+ %29 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+END
+CLEAR_COLOR variant_pipeline 0 0 0 255
+
+CLEAR variant_pipeline
+RUN variant_pipeline DRAW_RECT POS 0 0 SIZE 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific inst combine compares code path
+
+# 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_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0, 2.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# float f1(float a)
+# {
+# int b = 8;
+#
+# if (gl_FragCoord.y >= _float_0_0)
+# {
+# ++b;
+# ++b;
+# }
+#
+# // Always false.
+# if (a < _float_1_0)
+# {
+# return _float_1_0;
+# }
+#
+# float c = float(clamp(b, 0, 2));
+#
+# // Always returns 2.0.
+# return c;
+# }
+#
+# void main()
+# {
+# float a = f1(_float_1_0);
+# if (a == _float_2_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: 96
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %18 %71
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 320
+ OpName %4 "main"
+ OpName %10 "f1(f1;"
+ OpName %9 "a"
+ OpName %14 "b"
+ OpName %18 "gl_FragCoord"
+ OpName %26 "buf0"
+ OpMemberName %26 0 "_GLF_uniform_float_values"
+ OpName %28 ""
+ OpName %51 "c"
+ OpName %59 "a"
+ OpName %60 "param"
+ OpName %71 "_GLF_color"
+ OpName %74 "buf1"
+ OpMemberName %74 0 "_GLF_uniform_int_values"
+ OpName %76 ""
+ OpDecorate %18 BuiltIn FragCoord
+ OpDecorate %25 ArrayStride 16
+ OpMemberDecorate %26 0 Offset 0
+ OpDecorate %26 Block
+ OpDecorate %28 DescriptorSet 0
+ OpDecorate %28 Binding 0
+ OpDecorate %71 Location 0
+ OpDecorate %73 ArrayStride 16
+ OpMemberDecorate %74 0 Offset 0
+ OpDecorate %74 Block
+ OpDecorate %76 DescriptorSet 0
+ OpDecorate %76 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %8 = OpTypeFunction %6 %7
+ %12 = OpTypeInt 32 1
+ %13 = OpTypePointer Function %12
+ %15 = OpConstant %12 8
+ %16 = OpTypeVector %6 4
+ %17 = OpTypePointer Input %16
+ %18 = OpVariable %17 Input
+ %19 = OpTypeInt 32 0
+ %20 = OpConstant %19 1
+ %21 = OpTypePointer Input %6
+ %24 = OpConstant %19 3
+ %25 = OpTypeArray %6 %24
+ %26 = OpTypeStruct %25
+ %27 = OpTypePointer Uniform %26
+ %28 = OpVariable %27 Uniform
+ %29 = OpConstant %12 0
+ %30 = OpTypePointer Uniform %6
+ %33 = OpTypeBool
+ %38 = OpConstant %12 1
+ %53 = OpConstant %12 2
+ %70 = OpTypePointer Output %16
+ %71 = OpVariable %70 Output
+ %72 = OpConstant %19 2
+ %73 = OpTypeArray %12 %72
+ %74 = OpTypeStruct %73
+ %75 = OpTypePointer Uniform %74
+ %76 = OpVariable %75 Uniform
+ %77 = OpTypePointer Uniform %12
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %59 = OpVariable %7 Function
+ %60 = OpVariable %7 Function
+ %61 = OpAccessChain %30 %28 %29 %38
+ %62 = OpLoad %6 %61
+ OpStore %60 %62
+ %63 = OpFunctionCall %6 %10 %60
+ OpStore %59 %63
+ %64 = OpLoad %6 %59
+ %65 = OpAccessChain %30 %28 %29 %53
+ %66 = OpLoad %6 %65
+ %67 = OpFOrdEqual %33 %64 %66
+ OpSelectionMerge %69 None
+ OpBranchConditional %67 %68 %91
+ %68 = OpLabel
+ %78 = OpAccessChain %77 %76 %29 %38
+ %79 = OpLoad %12 %78
+ %80 = OpConvertSToF %6 %79
+ %81 = OpAccessChain %77 %76 %29 %29
+ %82 = OpLoad %12 %81
+ %83 = OpConvertSToF %6 %82
+ %84 = OpAccessChain %77 %76 %29 %29
+ %85 = OpLoad %12 %84
+ %86 = OpConvertSToF %6 %85
+ %87 = OpAccessChain %77 %76 %29 %38
+ %88 = OpLoad %12 %87
+ %89 = OpConvertSToF %6 %88
+ %90 = OpCompositeConstruct %16 %80 %83 %86 %89
+ OpStore %71 %90
+ OpBranch %69
+ %91 = OpLabel
+ %92 = OpAccessChain %77 %76 %29 %29
+ %93 = OpLoad %12 %92
+ %94 = OpConvertSToF %6 %93
+ %95 = OpCompositeConstruct %16 %94 %94 %94 %94
+ OpStore %71 %95
+ OpBranch %69
+ %69 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %10 = OpFunction %6 None %8
+ %9 = OpFunctionParameter %7
+ %11 = OpLabel
+ %14 = OpVariable %13 Function
+ %51 = OpVariable %7 Function
+ OpStore %14 %15
+ %22 = OpAccessChain %21 %18 %20
+ %23 = OpLoad %6 %22
+ %31 = OpAccessChain %30 %28 %29 %29
+ %32 = OpLoad %6 %31
+ %34 = OpFOrdGreaterThanEqual %33 %23 %32
+ OpSelectionMerge %36 None
+ OpBranchConditional %34 %35 %36
+ %35 = OpLabel
+ %37 = OpLoad %12 %14
+ %39 = OpIAdd %12 %37 %38
+ OpStore %14 %39
+ %40 = OpLoad %12 %14
+ %41 = OpIAdd %12 %40 %38
+ OpStore %14 %41
+ OpBranch %36
+ %36 = OpLabel
+ %42 = OpLoad %6 %9
+ %43 = OpAccessChain %30 %28 %29 %38
+ %44 = OpLoad %6 %43
+ %45 = OpFOrdLessThan %33 %42 %44
+ OpSelectionMerge %47 None
+ OpBranchConditional %45 %46 %47
+ %46 = OpLabel
+ %48 = OpAccessChain %30 %28 %29 %38
+ %49 = OpLoad %6 %48
+ OpReturnValue %49
+ %47 = OpLabel
+ %52 = OpLoad %12 %14
+ %54 = OpExtInst %12 %1 SClamp %52 %29 %53
+ %55 = OpConvertSToF %6 %54
+ OpStore %51 %55
+ %56 = OpLoad %6 %51
+ OpReturnValue %56
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0 2.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific inst combine mul div rem code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #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]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# float f1(float a)
+# {
+# return dFdx(a);
+# }
+#
+# void main()
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+# vec4 v2;
+#
+# // Always false.
+# if (gl_FragCoord.x < _float_0_0)
+# {
+# // v2 is undefined. Doesn't matter since this is never executed.
+# if (!(v2.x < 1.0))
+# {
+# float a = _float_0_0 / ((_float_0_0 > _float_1_0) ? f1(_float_1_0) : _float_1_0);
+# _GLF_color =
+# vec4(mix(vec3(_float_1_0), vec3(_float_1_0), a), _float_0_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: 104
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %18 %43
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %10 "f1(f1;"
+ OpName %9 "a"
+ OpName %18 "_GLF_color"
+ OpName %23 "buf0"
+ OpMemberName %23 0 "_GLF_uniform_int_values"
+ OpName %25 ""
+ OpName %43 "gl_FragCoord"
+ OpName %49 "buf1"
+ OpMemberName %49 0 "_GLF_uniform_float_values"
+ OpName %51 ""
+ OpName %60 "v2"
+ OpName %68 "a"
+ OpName %79 "param"
+ OpDecorate %18 Location 0
+ OpDecorate %22 ArrayStride 16
+ OpMemberDecorate %23 0 Offset 0
+ OpDecorate %23 Block
+ OpDecorate %25 DescriptorSet 0
+ OpDecorate %25 Binding 0
+ OpDecorate %43 BuiltIn FragCoord
+ OpDecorate %48 ArrayStride 16
+ OpMemberDecorate %49 0 Offset 0
+ OpDecorate %49 Block
+ OpDecorate %51 DescriptorSet 0
+ OpDecorate %51 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %8 = OpTypeFunction %6 %7
+ %16 = OpTypeVector %6 4
+ %17 = OpTypePointer Output %16
+ %18 = OpVariable %17 Output
+ %19 = OpTypeInt 32 1
+ %20 = OpTypeInt 32 0
+ %21 = OpConstant %20 2
+ %22 = OpTypeArray %19 %21
+ %23 = OpTypeStruct %22
+ %24 = OpTypePointer Uniform %23
+ %25 = OpVariable %24 Uniform
+ %26 = OpConstant %19 0
+ %27 = OpTypePointer Uniform %19
+ %31 = OpConstant %19 1
+ %42 = OpTypePointer Input %16
+ %43 = OpVariable %42 Input
+ %44 = OpConstant %20 0
+ %45 = OpTypePointer Input %6
+ %48 = OpTypeArray %6 %21
+ %49 = OpTypeStruct %48
+ %50 = OpTypePointer Uniform %49
+ %51 = OpVariable %50 Uniform
+ %52 = OpTypePointer Uniform %6
+ %55 = OpTypeBool
+ %59 = OpTypePointer Function %16
+ %63 = OpConstant %6 1
+ %90 = OpTypeVector %6 3
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %60 = OpVariable %59 Function
+ %68 = OpVariable %7 Function
+ %76 = OpVariable %7 Function
+ %79 = OpVariable %7 Function
+ %28 = OpAccessChain %27 %25 %26 %26
+ %29 = OpLoad %19 %28
+ %30 = OpConvertSToF %6 %29
+ %32 = OpAccessChain %27 %25 %26 %31
+ %33 = OpLoad %19 %32
+ %34 = OpConvertSToF %6 %33
+ %35 = OpAccessChain %27 %25 %26 %31
+ %36 = OpLoad %19 %35
+ %37 = OpConvertSToF %6 %36
+ %38 = OpAccessChain %27 %25 %26 %26
+ %39 = OpLoad %19 %38
+ %40 = OpConvertSToF %6 %39
+ %41 = OpCompositeConstruct %16 %30 %34 %37 %40
+ OpStore %18 %41
+ %46 = OpAccessChain %45 %43 %44
+ %47 = OpLoad %6 %46
+ %53 = OpAccessChain %52 %51 %26 %31
+ %54 = OpLoad %6 %53
+ %56 = OpFOrdLessThan %55 %47 %54
+ OpSelectionMerge %58 None
+ OpBranchConditional %56 %57 %58
+ %57 = OpLabel
+ %61 = OpAccessChain %7 %60 %44
+ %62 = OpLoad %6 %61
+ %64 = OpFOrdLessThan %55 %62 %63
+ %65 = OpLogicalNot %55 %64
+ OpSelectionMerge %67 None
+ OpBranchConditional %65 %66 %67
+ %66 = OpLabel
+ %69 = OpAccessChain %52 %51 %26 %31
+ %70 = OpLoad %6 %69
+ %71 = OpAccessChain %52 %51 %26 %31
+ %72 = OpLoad %6 %71
+ %73 = OpAccessChain %52 %51 %26 %26
+ %74 = OpLoad %6 %73
+ %75 = OpFOrdGreaterThan %55 %72 %74
+ OpSelectionMerge %78 None
+ OpBranchConditional %75 %77 %83
+ %77 = OpLabel
+ %80 = OpAccessChain %52 %51 %26 %26
+ %81 = OpLoad %6 %80
+ OpStore %79 %81
+ %82 = OpFunctionCall %6 %10 %79
+ OpStore %76 %82
+ OpBranch %78
+ %83 = OpLabel
+ %84 = OpAccessChain %52 %51 %26 %26
+ %85 = OpLoad %6 %84
+ OpStore %76 %85
+ OpBranch %78
+ %78 = OpLabel
+ %86 = OpLoad %6 %76
+ %87 = OpFDiv %6 %70 %86
+ OpStore %68 %87
+ %88 = OpAccessChain %52 %51 %26 %26
+ %89 = OpLoad %6 %88
+ %91 = OpCompositeConstruct %90 %89 %89 %89
+ %92 = OpAccessChain %52 %51 %26 %26
+ %93 = OpLoad %6 %92
+ %94 = OpCompositeConstruct %90 %93 %93 %93
+ %95 = OpLoad %6 %68
+ %96 = OpCompositeConstruct %90 %95 %95 %95
+ %97 = OpExtInst %90 %1 FMix %91 %94 %96
+ %98 = OpAccessChain %52 %51 %26 %31
+ %99 = OpLoad %6 %98
+ %100 = OpCompositeExtract %6 %97 0
+ %101 = OpCompositeExtract %6 %97 1
+ %102 = OpCompositeExtract %6 %97 2
+ %103 = OpCompositeConstruct %16 %100 %101 %102 %99
+ OpStore %18 %103
+ OpBranch %67
+ %67 = OpLabel
+ OpBranch %58
+ %58 = OpLabel
+ OpReturn
+ OpFunctionEnd
+ %10 = OpFunction %6 None %8
+ %9 = OpFunctionParameter %7
+ %11 = OpLabel
+ %12 = OpLoad %6 %9
+ %13 = OpDPdx %6 %12
+ OpReturnValue %13
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# injectionSwitch
+BUFFER variant_injectionSwitch DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+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
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant_injectionSwitch AS uniform DESCRIPTOR_SET 0 BINDING 2
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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: Covers specific combine shifts and combine simplify demanded 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 310 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]
+# #define _int_2 _GLF_uniform_int_values[3]
+# #define _float_0_25 _GLF_uniform_float_values[0]
+# #define _float_0_75 _GLF_uniform_float_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[2]
+# #define _float_127_0 _GLF_uniform_float_values[3]
+# #define _float_64_0 _GLF_uniform_float_values[4]
+# #define _float_1_0 _GLF_uniform_float_values[5]
+# #define _float_65_0 _GLF_uniform_float_values[6]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [3, 1, 0, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.25, 0.75, 0.0, 127.0, 64.0, 1.0, 65.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[7];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // Packs the two components into an unsigned integer of 3221176320.
+# uint a = packUnorm2x16(vec2(_float_0_25, _float_0_75));
+#
+# // Unpacks the integer into values of 0.0, 64.0, -1.0 and -65.0.
+# // Then converts them into floating-point values by dividing with 127.0.
+# vec4 v1 = unpackSnorm4x8(a);
+#
+# float E = 0.01;
+# if ( abs(v1[_int_0] - (_float_0_0 / _float_127_0)) < E
+# && abs(v1[_int_1] - (_float_64_0 / _float_127_0)) < E
+# && abs(v1[_int_2] - (-_float_1_0 / _float_127_0)) < E
+# && abs(v1[_int_3] - (-_float_65_0 / _float_127_0)) < E
+# )
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_float_1_0);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 130
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %112
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf1"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %28 "v1"
+ OpName %32 "E"
+ OpName %37 "buf0"
+ OpMemberName %37 0 "_GLF_uniform_int_values"
+ OpName %39 ""
+ OpName %112 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 1
+ OpDecorate %36 ArrayStride 16
+ OpMemberDecorate %37 0 Offset 0
+ OpDecorate %37 Block
+ OpDecorate %39 DescriptorSet 0
+ OpDecorate %39 Binding 0
+ OpDecorate %112 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeFloat 32
+ %10 = OpConstant %6 7
+ %11 = OpTypeArray %9 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpTypePointer Uniform %9
+ %20 = OpConstant %15 1
+ %23 = OpTypeVector %9 2
+ %26 = OpTypeVector %9 4
+ %27 = OpTypePointer Function %26
+ %31 = OpTypePointer Function %9
+ %33 = OpConstant %9 0.00999999978
+ %34 = OpTypeBool
+ %35 = OpConstant %6 4
+ %36 = OpTypeArray %15 %35
+ %37 = OpTypeStruct %36
+ %38 = OpTypePointer Uniform %37
+ %39 = OpVariable %38 Uniform
+ %40 = OpConstant %15 2
+ %41 = OpTypePointer Uniform %15
+ %48 = OpConstant %15 3
+ %62 = OpConstant %15 4
+ %79 = OpConstant %15 5
+ %97 = OpConstant %15 6
+ %111 = OpTypePointer Output %26
+ %112 = OpVariable %111 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %28 = OpVariable %27 Function
+ %32 = OpVariable %31 Function
+ %18 = OpAccessChain %17 %14 %16 %16
+ %19 = OpLoad %9 %18
+ %21 = OpAccessChain %17 %14 %16 %20
+ %22 = OpLoad %9 %21
+ %24 = OpCompositeConstruct %23 %19 %22
+ %25 = OpExtInst %6 %1 PackUnorm2x16 %24
+ OpStore %8 %25
+ %29 = OpLoad %6 %8
+ %30 = OpExtInst %26 %1 UnpackSnorm4x8 %29
+ OpStore %28 %30
+ OpStore %32 %33
+ %42 = OpAccessChain %41 %39 %16 %40
+ %43 = OpLoad %15 %42
+ %44 = OpAccessChain %31 %28 %43
+ %45 = OpLoad %9 %44
+ %46 = OpAccessChain %17 %14 %16 %40
+ %47 = OpLoad %9 %46
+ %49 = OpAccessChain %17 %14 %16 %48
+ %50 = OpLoad %9 %49
+ %51 = OpFDiv %9 %47 %50
+ %52 = OpFSub %9 %45 %51
+ %53 = OpExtInst %9 %1 FAbs %52
+ %54 = OpLoad %9 %32
+ %55 = OpFOrdLessThan %34 %53 %54
+ OpSelectionMerge %57 None
+ OpBranchConditional %55 %56 %57
+ %56 = OpLabel
+ %58 = OpAccessChain %41 %39 %16 %20
+ %59 = OpLoad %15 %58
+ %60 = OpAccessChain %31 %28 %59
+ %61 = OpLoad %9 %60
+ %63 = OpAccessChain %17 %14 %16 %62
+ %64 = OpLoad %9 %63
+ %65 = OpAccessChain %17 %14 %16 %48
+ %66 = OpLoad %9 %65
+ %67 = OpFDiv %9 %64 %66
+ %68 = OpFSub %9 %61 %67
+ %69 = OpExtInst %9 %1 FAbs %68
+ %70 = OpLoad %9 %32
+ %71 = OpFOrdLessThan %34 %69 %70
+ OpBranch %57
+ %57 = OpLabel
+ %72 = OpPhi %34 %55 %5 %71 %56
+ OpSelectionMerge %74 None
+ OpBranchConditional %72 %73 %74
+ %73 = OpLabel
+ %75 = OpAccessChain %41 %39 %16 %48
+ %76 = OpLoad %15 %75
+ %77 = OpAccessChain %31 %28 %76
+ %78 = OpLoad %9 %77
+ %80 = OpAccessChain %17 %14 %16 %79
+ %81 = OpLoad %9 %80
+ %82 = OpFNegate %9 %81
+ %83 = OpAccessChain %17 %14 %16 %48
+ %84 = OpLoad %9 %83
+ %85 = OpFDiv %9 %82 %84
+ %86 = OpFSub %9 %78 %85
+ %87 = OpExtInst %9 %1 FAbs %86
+ %88 = OpLoad %9 %32
+ %89 = OpFOrdLessThan %34 %87 %88
+ OpBranch %74
+ %74 = OpLabel
+ %90 = OpPhi %34 %72 %57 %89 %73
+ OpSelectionMerge %92 None
+ OpBranchConditional %90 %91 %92
+ %91 = OpLabel
+ %93 = OpAccessChain %41 %39 %16 %16
+ %94 = OpLoad %15 %93
+ %95 = OpAccessChain %31 %28 %94
+ %96 = OpLoad %9 %95
+ %98 = OpAccessChain %17 %14 %16 %97
+ %99 = OpLoad %9 %98
+ %100 = OpFNegate %9 %99
+ %101 = OpAccessChain %17 %14 %16 %48
+ %102 = OpLoad %9 %101
+ %103 = OpFDiv %9 %100 %102
+ %104 = OpFSub %9 %96 %103
+ %105 = OpExtInst %9 %1 FAbs %104
+ %106 = OpLoad %9 %32
+ %107 = OpFOrdLessThan %34 %105 %106
+ OpBranch %92
+ %92 = OpLabel
+ %108 = OpPhi %34 %90 %74 %107 %91
+ OpSelectionMerge %110 None
+ OpBranchConditional %108 %109 %126
+ %109 = OpLabel
+ %113 = OpAccessChain %41 %39 %16 %20
+ %114 = OpLoad %15 %113
+ %115 = OpConvertSToF %9 %114
+ %116 = OpAccessChain %41 %39 %16 %40
+ %117 = OpLoad %15 %116
+ %118 = OpConvertSToF %9 %117
+ %119 = OpAccessChain %41 %39 %16 %40
+ %120 = OpLoad %15 %119
+ %121 = OpConvertSToF %9 %120
+ %122 = OpAccessChain %41 %39 %16 %20
+ %123 = OpLoad %15 %122
+ %124 = OpConvertSToF %9 %123
+ %125 = OpCompositeConstruct %26 %115 %118 %121 %124
+ OpStore %112 %125
+ OpBranch %110
+ %126 = OpLabel
+ %127 = OpAccessChain %17 %14 %16 %79
+ %128 = OpLoad %9 %127
+ %129 = OpCompositeConstruct %26 %128 %128 %128 %128
+ OpStore %112 %129
+ OpBranch %110
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.25 0.75 0.0 127.0 64.0 1.0 65.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 1 0 2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific instruction combine select code path
+
+# 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 310 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_4 _GLF_uniform_int_values[1]
+# #define _int_0 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #define _int_2 _GLF_uniform_int_values[4]
+# #define _uint_0 _GLF_uniform_uint_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _uint_4294967294 _GLF_uniform_uint_values[1]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_uint_values: 0
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# uint _GLF_uniform_uint_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [10, 4, 0, 1, 2]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[5];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0]
+# layout(set = 0, binding = 2) uniform buf2
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of A: [0.0, 1.0]
+# layout(set = 0, binding = 3) uniform buf3
+# {
+# vec2 A;
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# float f1()
+# {
+# // Always false.
+# if (A.x > A.y)
+# {
+# // Always false.
+# if (gl_FragCoord.y < _float_0_0)
+# {
+# return _float_0_0;
+# }
+# }
+#
+# // Always false.
+# if (_float_0_0 > A.x)
+# {
+# // Always false.
+# if (A.x > A.y)
+# {
+# return _float_0_0;
+# }
+# }
+# for (int i = _int_0; i < _int_10; i++)
+# {
+# // Always false.
+# if (gl_FragCoord.x < _float_0_0)
+# {
+# return _float_0_0;
+# }
+# }
+#
+# // Always returns 1.0.
+# return _float_1_0;
+# }
+#
+# void main()
+# {
+# float data[2];
+#
+# data[0] = 0.1;
+# data[1] = 0.2;
+#
+# // Loops over two times.
+# for (int j = _int_0; j < findLSB(_int_4); j++)
+# {
+# uint index = _uint_0;
+#
+# uaddCarry(uint(_int_2 * j), _uint_4294967294, index);
+# data[index] = f1() - float(index);
+# }
+#
+# _GLF_color = vec4(data[_int_0], data[_int_1], data[_int_1], data[_int_0]);
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 170
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %30 %151
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "f1("
+ OpName %11 "buf3"
+ OpMemberName %11 0 "A"
+ OpName %13 ""
+ OpName %30 "gl_FragCoord"
+ OpName %36 "buf2"
+ OpMemberName %36 0 "_GLF_uniform_float_values"
+ OpName %38 ""
+ OpName %66 "i"
+ OpName %69 "buf1"
+ OpMemberName %69 0 "_GLF_uniform_int_values"
+ OpName %71 ""
+ OpName %102 "data"
+ OpName %108 "j"
+ OpName %122 "index"
+ OpName %124 "buf0"
+ OpMemberName %124 0 "_GLF_uniform_uint_values"
+ OpName %126 ""
+ OpName %138 "ResType"
+ OpName %151 "_GLF_color"
+ OpMemberDecorate %11 0 Offset 0
+ OpDecorate %11 Block
+ OpDecorate %13 DescriptorSet 0
+ OpDecorate %13 Binding 3
+ OpDecorate %30 BuiltIn FragCoord
+ OpDecorate %35 ArrayStride 16
+ OpMemberDecorate %36 0 Offset 0
+ OpDecorate %36 Block
+ OpDecorate %38 DescriptorSet 0
+ OpDecorate %38 Binding 2
+ OpDecorate %68 ArrayStride 16
+ OpMemberDecorate %69 0 Offset 0
+ OpDecorate %69 Block
+ OpDecorate %71 DescriptorSet 0
+ OpDecorate %71 Binding 1
+ OpDecorate %123 ArrayStride 16
+ OpMemberDecorate %124 0 Offset 0
+ OpDecorate %124 Block
+ OpDecorate %126 DescriptorSet 0
+ OpDecorate %126 Binding 0
+ OpDecorate %151 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeFunction %6
+ %10 = OpTypeVector %6 2
+ %11 = OpTypeStruct %10
+ %12 = OpTypePointer Uniform %11
+ %13 = OpVariable %12 Uniform
+ %14 = OpTypeInt 32 1
+ %15 = OpConstant %14 0
+ %16 = OpTypeInt 32 0
+ %17 = OpConstant %16 0
+ %18 = OpTypePointer Uniform %6
+ %21 = OpConstant %16 1
+ %24 = OpTypeBool
+ %28 = OpTypeVector %6 4
+ %29 = OpTypePointer Input %28
+ %30 = OpVariable %29 Input
+ %31 = OpTypePointer Input %6
+ %34 = OpConstant %16 2
+ %35 = OpTypeArray %6 %34
+ %36 = OpTypeStruct %35
+ %37 = OpTypePointer Uniform %36
+ %38 = OpVariable %37 Uniform
+ %39 = OpConstant %14 1
+ %65 = OpTypePointer Function %14
+ %67 = OpConstant %16 5
+ %68 = OpTypeArray %14 %67
+ %69 = OpTypeStruct %68
+ %70 = OpTypePointer Uniform %69
+ %71 = OpVariable %70 Uniform
+ %72 = OpConstant %14 2
+ %73 = OpTypePointer Uniform %14
+ %101 = OpTypePointer Function %35
+ %103 = OpConstant %6 0.100000001
+ %104 = OpTypePointer Function %6
+ %106 = OpConstant %6 0.200000003
+ %121 = OpTypePointer Function %16
+ %123 = OpTypeArray %16 %34
+ %124 = OpTypeStruct %123
+ %125 = OpTypePointer Uniform %124
+ %126 = OpVariable %125 Uniform
+ %127 = OpTypePointer Uniform %16
+ %130 = OpConstant %14 4
+ %138 = OpTypeStruct %16 %16
+ %150 = OpTypePointer Output %28
+ %151 = OpVariable %150 Output
+ %156 = OpConstant %14 3
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %102 = OpVariable %101 Function
+ %108 = OpVariable %65 Function
+ %122 = OpVariable %121 Function
+ %105 = OpAccessChain %104 %102 %15
+ OpStore %105 %103
+ %107 = OpAccessChain %104 %102 %39
+ OpStore %107 %106
+ %109 = OpAccessChain %73 %71 %15 %72
+ %110 = OpLoad %14 %109
+ OpStore %108 %110
+ OpBranch %111
+ %111 = OpLabel
+ OpLoopMerge %113 %114 None
+ OpBranch %115
+ %115 = OpLabel
+ %116 = OpLoad %14 %108
+ %117 = OpAccessChain %73 %71 %15 %39
+ %118 = OpLoad %14 %117
+ %119 = OpExtInst %14 %1 FindILsb %118
+ %120 = OpSLessThan %24 %116 %119
+ OpBranchConditional %120 %112 %113
+ %112 = OpLabel
+ %128 = OpAccessChain %127 %126 %15 %15
+ %129 = OpLoad %16 %128
+ OpStore %122 %129
+ %131 = OpAccessChain %73 %71 %15 %130
+ %132 = OpLoad %14 %131
+ %133 = OpLoad %14 %108
+ %134 = OpIMul %14 %132 %133
+ %135 = OpBitcast %16 %134
+ %136 = OpAccessChain %127 %126 %15 %39
+ %137 = OpLoad %16 %136
+ %139 = OpIAddCarry %138 %135 %137
+ %140 = OpCompositeExtract %16 %139 1
+ OpStore %122 %140
+ %141 = OpCompositeExtract %16 %139 0
+ %142 = OpLoad %16 %122
+ %143 = OpFunctionCall %6 %8
+ %144 = OpLoad %16 %122
+ %145 = OpConvertUToF %6 %144
+ %146 = OpFSub %6 %143 %145
+ %147 = OpAccessChain %104 %102 %142
+ OpStore %147 %146
+ OpBranch %114
+ %114 = OpLabel
+ %148 = OpLoad %14 %108
+ %149 = OpIAdd %14 %148 %39
+ OpStore %108 %149
+ OpBranch %111
+ %113 = OpLabel
+ %152 = OpAccessChain %73 %71 %15 %72
+ %153 = OpLoad %14 %152
+ %154 = OpAccessChain %104 %102 %153
+ %155 = OpLoad %6 %154
+ %157 = OpAccessChain %73 %71 %15 %156
+ %158 = OpLoad %14 %157
+ %159 = OpAccessChain %104 %102 %158
+ %160 = OpLoad %6 %159
+ %161 = OpAccessChain %73 %71 %15 %156
+ %162 = OpLoad %14 %161
+ %163 = OpAccessChain %104 %102 %162
+ %164 = OpLoad %6 %163
+ %165 = OpAccessChain %73 %71 %15 %72
+ %166 = OpLoad %14 %165
+ %167 = OpAccessChain %104 %102 %166
+ %168 = OpLoad %6 %167
+ %169 = OpCompositeConstruct %28 %155 %160 %164 %168
+ OpStore %151 %169
+ OpReturn
+ OpFunctionEnd
+ %8 = OpFunction %6 None %7
+ %9 = OpLabel
+ %66 = OpVariable %65 Function
+ %19 = OpAccessChain %18 %13 %15 %17
+ %20 = OpLoad %6 %19
+ %22 = OpAccessChain %18 %13 %15 %21
+ %23 = OpLoad %6 %22
+ %25 = OpFOrdGreaterThan %24 %20 %23
+ OpSelectionMerge %27 None
+ OpBranchConditional %25 %26 %27
+ %26 = OpLabel
+ %32 = OpAccessChain %31 %30 %21
+ %33 = OpLoad %6 %32
+ %40 = OpAccessChain %18 %38 %15 %39
+ %41 = OpLoad %6 %40
+ %42 = OpFOrdLessThan %24 %33 %41
+ OpSelectionMerge %44 None
+ OpBranchConditional %42 %43 %44
+ %43 = OpLabel
+ %45 = OpAccessChain %18 %38 %15 %39
+ %46 = OpLoad %6 %45
+ OpReturnValue %46
+ %44 = OpLabel
+ OpBranch %27
+ %27 = OpLabel
+ %48 = OpAccessChain %18 %38 %15 %39
+ %49 = OpLoad %6 %48
+ %50 = OpAccessChain %18 %13 %15 %17
+ %51 = OpLoad %6 %50
+ %52 = OpFOrdGreaterThan %24 %49 %51
+ OpSelectionMerge %54 None
+ OpBranchConditional %52 %53 %54
+ %53 = OpLabel
+ %55 = OpAccessChain %18 %13 %15 %17
+ %56 = OpLoad %6 %55
+ %57 = OpAccessChain %18 %13 %15 %21
+ %58 = OpLoad %6 %57
+ %59 = OpFOrdGreaterThan %24 %56 %58
+ OpSelectionMerge %61 None
+ OpBranchConditional %59 %60 %61
+ %60 = OpLabel
+ %62 = OpAccessChain %18 %38 %15 %39
+ %63 = OpLoad %6 %62
+ OpReturnValue %63
+ %61 = OpLabel
+ OpBranch %54
+ %54 = OpLabel
+ %74 = OpAccessChain %73 %71 %15 %72
+ %75 = OpLoad %14 %74
+ OpStore %66 %75
+ OpBranch %76
+ %76 = OpLabel
+ OpLoopMerge %78 %79 None
+ OpBranch %80
+ %80 = OpLabel
+ %81 = OpLoad %14 %66
+ %82 = OpAccessChain %73 %71 %15 %15
+ %83 = OpLoad %14 %82
+ %84 = OpSLessThan %24 %81 %83
+ OpBranchConditional %84 %77 %78
+ %77 = OpLabel
+ %85 = OpAccessChain %31 %30 %17
+ %86 = OpLoad %6 %85
+ %87 = OpAccessChain %18 %38 %15 %39
+ %88 = OpLoad %6 %87
+ %89 = OpFOrdLessThan %24 %86 %88
+ OpSelectionMerge %91 None
+ OpBranchConditional %89 %90 %91
+ %90 = OpLabel
+ %92 = OpAccessChain %18 %38 %15 %39
+ %93 = OpLoad %6 %92
+ OpReturnValue %93
+ %91 = OpLabel
+ OpBranch %79
+ %79 = OpLabel
+ %95 = OpLoad %14 %66
+ %96 = OpIAdd %14 %95 %39
+ OpStore %66 %96
+ OpBranch %76
+ %78 = OpLabel
+ %97 = OpAccessChain %18 %38 %15 %15
+ %98 = OpLoad %6 %97
+ OpReturnValue %98
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# A
+BUFFER variant_A DATA_TYPE vec2<float> STD140 DATA
+ 0.0 1.0
+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
+ 10 4 0 1 2
+END
+# _GLF_uniform_uint_values
+BUFFER variant__GLF_uniform_uint_values DATA_TYPE int32[] STD140 DATA
+ 0 4294967294
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ BIND BUFFER variant_A AS uniform DESCRIPTOR_SET 0 BINDING 3
+ BIND BUFFER variant__GLF_uniform_float_values 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_uint_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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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: Covers a specific instruction combine simplify demanded code path
+
+# 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 310 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 _int_3 _GLF_uniform_int_values[3]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_127_0 _GLF_uniform_float_values[1]
+# #define _float_60_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 127.0, 60.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 2, 3]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // Converts the two 32-bit floating-point quantities to 16-bit quantities
+# // and packs them into a 32-bit unsigned integer of 1006648320.
+# uint a = packHalf2x16(vec2(1.0));
+#
+# // Unpacks the integer into 8-bit signed integers of values 0.0, 60.0, 0.0 and 60.0.
+# // Then converts them into normalized floating-point numbers by dividing 127.0.
+# vec4 v1 = unpackSnorm4x8(a);
+#
+# float E = 0.01;
+# if (abs(v1[_int_0] - (_float_0_0 / _float_127_0)) < E
+# && abs(v1[_int_1] - (_float_60_0 / _float_127_0)) < E
+# && abs(v1[_int_2] - (_float_0_0 / _float_127_0)) < E
+# && abs(v1[_int_3] - (_float_60_0 / _float_127_0)) < E)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(v1[_int_0]);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 124
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %104
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %16 "v1"
+ OpName %20 "E"
+ OpName %26 "buf1"
+ OpMemberName %26 0 "_GLF_uniform_int_values"
+ OpName %28 ""
+ OpName %38 "buf0"
+ OpMemberName %38 0 "_GLF_uniform_float_values"
+ OpName %40 ""
+ OpName %104 "_GLF_color"
+ OpDecorate %25 ArrayStride 16
+ OpMemberDecorate %26 0 Offset 0
+ OpDecorate %26 Block
+ OpDecorate %28 DescriptorSet 0
+ OpDecorate %28 Binding 1
+ OpDecorate %37 ArrayStride 16
+ OpMemberDecorate %38 0 Offset 0
+ OpDecorate %38 Block
+ OpDecorate %40 DescriptorSet 0
+ OpDecorate %40 Binding 0
+ OpDecorate %104 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeFloat 32
+ %10 = OpTypeVector %9 2
+ %11 = OpConstant %9 1
+ %12 = OpConstantComposite %10 %11 %11
+ %14 = OpTypeVector %9 4
+ %15 = OpTypePointer Function %14
+ %19 = OpTypePointer Function %9
+ %21 = OpConstant %9 0.00999999978
+ %22 = OpTypeBool
+ %23 = OpTypeInt 32 1
+ %24 = OpConstant %6 4
+ %25 = OpTypeArray %23 %24
+ %26 = OpTypeStruct %25
+ %27 = OpTypePointer Uniform %26
+ %28 = OpVariable %27 Uniform
+ %29 = OpConstant %23 0
+ %30 = OpConstant %23 1
+ %31 = OpTypePointer Uniform %23
+ %36 = OpConstant %6 3
+ %37 = OpTypeArray %9 %36
+ %38 = OpTypeStruct %37
+ %39 = OpTypePointer Uniform %38
+ %40 = OpVariable %39 Uniform
+ %41 = OpTypePointer Uniform %9
+ %57 = OpConstant %23 2
+ %86 = OpConstant %23 3
+ %103 = OpTypePointer Output %14
+ %104 = OpVariable %103 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %16 = OpVariable %15 Function
+ %20 = OpVariable %19 Function
+ %13 = OpExtInst %6 %1 PackHalf2x16 %12
+ OpStore %8 %13
+ %17 = OpLoad %6 %8
+ %18 = OpExtInst %14 %1 UnpackSnorm4x8 %17
+ OpStore %16 %18
+ OpStore %20 %21
+ %32 = OpAccessChain %31 %28 %29 %30
+ %33 = OpLoad %23 %32
+ %34 = OpAccessChain %19 %16 %33
+ %35 = OpLoad %9 %34
+ %42 = OpAccessChain %41 %40 %29 %29
+ %43 = OpLoad %9 %42
+ %44 = OpAccessChain %41 %40 %29 %30
+ %45 = OpLoad %9 %44
+ %46 = OpFDiv %9 %43 %45
+ %47 = OpFSub %9 %35 %46
+ %48 = OpExtInst %9 %1 FAbs %47
+ %49 = OpLoad %9 %20
+ %50 = OpFOrdLessThan %22 %48 %49
+ OpSelectionMerge %52 None
+ OpBranchConditional %50 %51 %52
+ %51 = OpLabel
+ %53 = OpAccessChain %31 %28 %29 %29
+ %54 = OpLoad %23 %53
+ %55 = OpAccessChain %19 %16 %54
+ %56 = OpLoad %9 %55
+ %58 = OpAccessChain %41 %40 %29 %57
+ %59 = OpLoad %9 %58
+ %60 = OpAccessChain %41 %40 %29 %30
+ %61 = OpLoad %9 %60
+ %62 = OpFDiv %9 %59 %61
+ %63 = OpFSub %9 %56 %62
+ %64 = OpExtInst %9 %1 FAbs %63
+ %65 = OpLoad %9 %20
+ %66 = OpFOrdLessThan %22 %64 %65
+ OpBranch %52
+ %52 = OpLabel
+ %67 = OpPhi %22 %50 %5 %66 %51
+ OpSelectionMerge %69 None
+ OpBranchConditional %67 %68 %69
+ %68 = OpLabel
+ %70 = OpAccessChain %31 %28 %29 %57
+ %71 = OpLoad %23 %70
+ %72 = OpAccessChain %19 %16 %71
+ %73 = OpLoad %9 %72
+ %74 = OpAccessChain %41 %40 %29 %29
+ %75 = OpLoad %9 %74
+ %76 = OpAccessChain %41 %40 %29 %30
+ %77 = OpLoad %9 %76
+ %78 = OpFDiv %9 %75 %77
+ %79 = OpFSub %9 %73 %78
+ %80 = OpExtInst %9 %1 FAbs %79
+ %81 = OpLoad %9 %20
+ %82 = OpFOrdLessThan %22 %80 %81
+ OpBranch %69
+ %69 = OpLabel
+ %83 = OpPhi %22 %67 %52 %82 %68
+ OpSelectionMerge %85 None
+ OpBranchConditional %83 %84 %85
+ %84 = OpLabel
+ %87 = OpAccessChain %31 %28 %29 %86
+ %88 = OpLoad %23 %87
+ %89 = OpAccessChain %19 %16 %88
+ %90 = OpLoad %9 %89
+ %91 = OpAccessChain %41 %40 %29 %57
+ %92 = OpLoad %9 %91
+ %93 = OpAccessChain %41 %40 %29 %30
+ %94 = OpLoad %9 %93
+ %95 = OpFDiv %9 %92 %94
+ %96 = OpFSub %9 %90 %95
+ %97 = OpExtInst %9 %1 FAbs %96
+ %98 = OpLoad %9 %20
+ %99 = OpFOrdLessThan %22 %97 %98
+ OpBranch %85
+ %85 = OpLabel
+ %100 = OpPhi %22 %83 %69 %99 %84
+ OpSelectionMerge %102 None
+ OpBranchConditional %100 %101 %118
+ %101 = OpLabel
+ %105 = OpAccessChain %31 %28 %29 %29
+ %106 = OpLoad %23 %105
+ %107 = OpConvertSToF %9 %106
+ %108 = OpAccessChain %31 %28 %29 %30
+ %109 = OpLoad %23 %108
+ %110 = OpConvertSToF %9 %109
+ %111 = OpAccessChain %31 %28 %29 %30
+ %112 = OpLoad %23 %111
+ %113 = OpConvertSToF %9 %112
+ %114 = OpAccessChain %31 %28 %29 %29
+ %115 = OpLoad %23 %114
+ %116 = OpConvertSToF %9 %115
+ %117 = OpCompositeConstruct %14 %107 %110 %113 %116
+ OpStore %104 %117
+ OpBranch %102
+ %118 = OpLabel
+ %119 = OpAccessChain %31 %28 %29 %30
+ %120 = OpLoad %23 %119
+ %121 = OpAccessChain %19 %16 %120
+ %122 = OpLoad %9 %121
+ %123 = OpCompositeConstruct %14 %122 %122 %122 %122
+ OpStore %104 %123
+ OpBranch %102
+ %102 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 2 3
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 127.0 60.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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: Covers a specific instruction combine simplify demanded code path
+
+# 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 310 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]
+# #define _int_2 _GLF_uniform_int_values[3]
+# #define _float_0_01 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_127_0 _GLF_uniform_float_values[2]
+# #define _float_255_0 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [1, 0, 3, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.01, 1.0, 127.0, 255.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[4];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // Converts the components into signed 8-bit integers and packs the result
+# // into an unsigned integer of 2139062143.
+# uint a = packSnorm4x8(vec4(_float_1_0));
+#
+# // Unpacks the integer into four 8-bit unsigned integers and converts
+# // them into a floating-point value of 0.5.
+# vec4 v1 = unpackUnorm4x8(a);
+#
+# float E = _float_0_01;
+# if (abs(v1[_int_0] - (_float_127_0/_float_255_0)) < E &&
+# abs(v1[_int_1] - (_float_127_0/_float_255_0)) < E &&
+# abs(v1[_int_2] - (_float_127_0/_float_255_0)) < E &&
+# abs(v1[_int_3] - (_float_127_0/_float_255_0)) < E)
+# {
+# _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; 8
+; Bound: 123
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %104
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf1"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %25 "v1"
+ OpName %29 "E"
+ OpName %34 "buf0"
+ OpMemberName %34 0 "_GLF_uniform_int_values"
+ OpName %36 ""
+ OpName %104 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 1
+ OpDecorate %33 ArrayStride 16
+ OpMemberDecorate %34 0 Offset 0
+ OpDecorate %34 Block
+ OpDecorate %36 DescriptorSet 0
+ OpDecorate %36 Binding 0
+ OpDecorate %104 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 0
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeFloat 32
+ %10 = OpConstant %6 4
+ %11 = OpTypeArray %9 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpConstant %15 1
+ %18 = OpTypePointer Uniform %9
+ %21 = OpTypeVector %9 4
+ %24 = OpTypePointer Function %21
+ %28 = OpTypePointer Function %9
+ %32 = OpTypeBool
+ %33 = OpTypeArray %15 %10
+ %34 = OpTypeStruct %33
+ %35 = OpTypePointer Uniform %34
+ %36 = OpVariable %35 Uniform
+ %37 = OpTypePointer Uniform %15
+ %42 = OpConstant %15 2
+ %45 = OpConstant %15 3
+ %103 = OpTypePointer Output %21
+ %104 = OpVariable %103 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %25 = OpVariable %24 Function
+ %29 = OpVariable %28 Function
+ %19 = OpAccessChain %18 %14 %16 %17
+ %20 = OpLoad %9 %19
+ %22 = OpCompositeConstruct %21 %20 %20 %20 %20
+ %23 = OpExtInst %6 %1 PackSnorm4x8 %22
+ OpStore %8 %23
+ %26 = OpLoad %6 %8
+ %27 = OpExtInst %21 %1 UnpackUnorm4x8 %26
+ OpStore %25 %27
+ %30 = OpAccessChain %18 %14 %16 %16
+ %31 = OpLoad %9 %30
+ OpStore %29 %31
+ %38 = OpAccessChain %37 %36 %16 %17
+ %39 = OpLoad %15 %38
+ %40 = OpAccessChain %28 %25 %39
+ %41 = OpLoad %9 %40
+ %43 = OpAccessChain %18 %14 %16 %42
+ %44 = OpLoad %9 %43
+ %46 = OpAccessChain %18 %14 %16 %45
+ %47 = OpLoad %9 %46
+ %48 = OpFDiv %9 %44 %47
+ %49 = OpFSub %9 %41 %48
+ %50 = OpExtInst %9 %1 FAbs %49
+ %51 = OpLoad %9 %29
+ %52 = OpFOrdLessThan %32 %50 %51
+ OpSelectionMerge %54 None
+ OpBranchConditional %52 %53 %54
+ %53 = OpLabel
+ %55 = OpAccessChain %37 %36 %16 %16
+ %56 = OpLoad %15 %55
+ %57 = OpAccessChain %28 %25 %56
+ %58 = OpLoad %9 %57
+ %59 = OpAccessChain %18 %14 %16 %42
+ %60 = OpLoad %9 %59
+ %61 = OpAccessChain %18 %14 %16 %45
+ %62 = OpLoad %9 %61
+ %63 = OpFDiv %9 %60 %62
+ %64 = OpFSub %9 %58 %63
+ %65 = OpExtInst %9 %1 FAbs %64
+ %66 = OpLoad %9 %29
+ %67 = OpFOrdLessThan %32 %65 %66
+ OpBranch %54
+ %54 = OpLabel
+ %68 = OpPhi %32 %52 %5 %67 %53
+ OpSelectionMerge %70 None
+ OpBranchConditional %68 %69 %70
+ %69 = OpLabel
+ %71 = OpAccessChain %37 %36 %16 %45
+ %72 = OpLoad %15 %71
+ %73 = OpAccessChain %28 %25 %72
+ %74 = OpLoad %9 %73
+ %75 = OpAccessChain %18 %14 %16 %42
+ %76 = OpLoad %9 %75
+ %77 = OpAccessChain %18 %14 %16 %45
+ %78 = OpLoad %9 %77
+ %79 = OpFDiv %9 %76 %78
+ %80 = OpFSub %9 %74 %79
+ %81 = OpExtInst %9 %1 FAbs %80
+ %82 = OpLoad %9 %29
+ %83 = OpFOrdLessThan %32 %81 %82
+ OpBranch %70
+ %70 = OpLabel
+ %84 = OpPhi %32 %68 %54 %83 %69
+ OpSelectionMerge %86 None
+ OpBranchConditional %84 %85 %86
+ %85 = OpLabel
+ %87 = OpAccessChain %37 %36 %16 %42
+ %88 = OpLoad %15 %87
+ %89 = OpAccessChain %28 %25 %88
+ %90 = OpLoad %9 %89
+ %91 = OpAccessChain %18 %14 %16 %42
+ %92 = OpLoad %9 %91
+ %93 = OpAccessChain %18 %14 %16 %45
+ %94 = OpLoad %9 %93
+ %95 = OpFDiv %9 %92 %94
+ %96 = OpFSub %9 %90 %95
+ %97 = OpExtInst %9 %1 FAbs %96
+ %98 = OpLoad %9 %29
+ %99 = OpFOrdLessThan %32 %97 %98
+ OpBranch %86
+ %86 = OpLabel
+ %100 = OpPhi %32 %84 %70 %99 %85
+ OpSelectionMerge %102 None
+ OpBranchConditional %100 %101 %118
+ %101 = OpLabel
+ %105 = OpAccessChain %37 %36 %16 %16
+ %106 = OpLoad %15 %105
+ %107 = OpConvertSToF %9 %106
+ %108 = OpAccessChain %37 %36 %16 %17
+ %109 = OpLoad %15 %108
+ %110 = OpConvertSToF %9 %109
+ %111 = OpAccessChain %37 %36 %16 %17
+ %112 = OpLoad %15 %111
+ %113 = OpConvertSToF %9 %112
+ %114 = OpAccessChain %37 %36 %16 %16
+ %115 = OpLoad %15 %114
+ %116 = OpConvertSToF %9 %115
+ %117 = OpCompositeConstruct %21 %107 %110 %113 %116
+ OpStore %104 %117
+ OpBranch %102
+ %118 = OpLabel
+ %119 = OpAccessChain %37 %36 %16 %17
+ %120 = OpLoad %15 %119
+ %121 = OpConvertSToF %9 %120
+ %122 = OpCompositeConstruct %21 %121 %121 %121 %121
+ OpStore %104 %122
+ OpBranch %102
+ %102 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.01 1.0 127.0 255.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 0 3 2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific inst combine simplify demanded path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 1.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# vec4 color = vec4(_float_0_0, _float_0_0, _float_0_0, _float_1_0);
+# switch ((1 | _int_1) ^ 1)
+# {
+# case 0:
+# color[_int_0] = _float_1_0;
+# break;
+# }
+#
+# _GLF_color = color;
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 51
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %49
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "color"
+ OpName %13 "buf0"
+ OpMemberName %13 0 "_GLF_uniform_float_values"
+ OpName %15 ""
+ OpName %30 "buf1"
+ OpMemberName %30 0 "_GLF_uniform_int_values"
+ OpName %32 ""
+ OpName %49 "_GLF_color"
+ OpDecorate %12 ArrayStride 16
+ OpMemberDecorate %13 0 Offset 0
+ OpDecorate %13 Block
+ OpDecorate %15 DescriptorSet 0
+ OpDecorate %15 Binding 0
+ OpDecorate %29 ArrayStride 16
+ OpMemberDecorate %30 0 Offset 0
+ OpDecorate %30 Block
+ OpDecorate %32 DescriptorSet 0
+ OpDecorate %32 Binding 1
+ OpDecorate %49 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 4
+ %8 = OpTypePointer Function %7
+ %10 = OpTypeInt 32 0
+ %11 = OpConstant %10 2
+ %12 = OpTypeArray %6 %11
+ %13 = OpTypeStruct %12
+ %14 = OpTypePointer Uniform %13
+ %15 = OpVariable %14 Uniform
+ %16 = OpTypeInt 32 1
+ %17 = OpConstant %16 0
+ %18 = OpTypePointer Uniform %6
+ %25 = OpConstant %16 1
+ %29 = OpTypeArray %16 %11
+ %30 = OpTypeStruct %29
+ %31 = OpTypePointer Uniform %30
+ %32 = OpVariable %31 Uniform
+ %33 = OpTypePointer Uniform %16
+ %44 = OpTypePointer Function %6
+ %48 = OpTypePointer Output %7
+ %49 = OpVariable %48 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %19 = OpAccessChain %18 %15 %17 %17
+ %20 = OpLoad %6 %19
+ %21 = OpAccessChain %18 %15 %17 %17
+ %22 = OpLoad %6 %21
+ %23 = OpAccessChain %18 %15 %17 %17
+ %24 = OpLoad %6 %23
+ %26 = OpAccessChain %18 %15 %17 %25
+ %27 = OpLoad %6 %26
+ %28 = OpCompositeConstruct %7 %20 %22 %24 %27
+ OpStore %9 %28
+ %34 = OpAccessChain %33 %32 %17 %25
+ %35 = OpLoad %16 %34
+ %36 = OpBitwiseOr %16 %25 %35
+ %37 = OpBitwiseXor %16 %36 %25
+ OpSelectionMerge %39 None
+ OpSwitch %37 %39 0 %38
+ %38 = OpLabel
+ %40 = OpAccessChain %33 %32 %17 %17
+ %41 = OpLoad %16 %40
+ %42 = OpAccessChain %18 %15 %17 %25
+ %43 = OpLoad %6 %42
+ %45 = OpAccessChain %44 %9 %41
+ OpStore %45 %43
+ OpBranch %39
+ %39 = OpLabel
+ %50 = OpLoad %7 %9
+ OpStore %49 %50
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 1.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 inst combine vector ops 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 310 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_0_25 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_0_281 _GLF_uniform_float_values[2]
+# #define _float_0_282 _GLF_uniform_float_values[3]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.25, 1.0, 0.281, 0.282]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[4];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [10, 0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float a = _float_0_25;
+# float b;
+# float c;
+# for (int i = _int_0; i < _int_10; i++)
+# {
+# b = a;
+# c = b;
+# float d = asin(c);
+# c = _float_1_0;
+# a = d;
+# }
+#
+# if ((_float_0_281 < a) && (a < _float_0_282))
+# {
+# _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; 8
+; Bound: 89
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %70
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %21 "i"
+ OpName %24 "buf1"
+ OpMemberName %24 0 "_GLF_uniform_int_values"
+ OpName %26 ""
+ OpName %41 "b"
+ OpName %43 "c"
+ OpName %45 "d"
+ OpName %70 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %23 ArrayStride 16
+ OpMemberDecorate %24 0 Offset 0
+ OpDecorate %24 Block
+ OpDecorate %26 DescriptorSet 0
+ OpDecorate %26 Binding 1
+ OpDecorate %70 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %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 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpTypePointer Uniform %6
+ %20 = OpTypePointer Function %15
+ %22 = OpConstant %9 3
+ %23 = OpTypeArray %15 %22
+ %24 = OpTypeStruct %23
+ %25 = OpTypePointer Uniform %24
+ %26 = OpVariable %25 Uniform
+ %27 = OpConstant %15 1
+ %28 = OpTypePointer Uniform %15
+ %39 = OpTypeBool
+ %53 = OpConstant %15 2
+ %61 = OpConstant %15 3
+ %68 = OpTypeVector %6 4
+ %69 = OpTypePointer Output %68
+ %70 = OpVariable %69 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %21 = OpVariable %20 Function
+ %41 = OpVariable %7 Function
+ %43 = OpVariable %7 Function
+ %45 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %16 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ %29 = OpAccessChain %28 %26 %16 %27
+ %30 = OpLoad %15 %29
+ OpStore %21 %30
+ OpBranch %31
+ %31 = OpLabel
+ OpLoopMerge %33 %34 None
+ OpBranch %35
+ %35 = OpLabel
+ %36 = OpLoad %15 %21
+ %37 = OpAccessChain %28 %26 %16 %16
+ %38 = OpLoad %15 %37
+ %40 = OpSLessThan %39 %36 %38
+ OpBranchConditional %40 %32 %33
+ %32 = OpLabel
+ %42 = OpLoad %6 %8
+ OpStore %41 %42
+ %44 = OpLoad %6 %41
+ OpStore %43 %44
+ %46 = OpLoad %6 %43
+ %47 = OpExtInst %6 %1 Asin %46
+ OpStore %45 %47
+ %48 = OpAccessChain %17 %14 %16 %27
+ %49 = OpLoad %6 %48
+ OpStore %43 %49
+ %50 = OpLoad %6 %45
+ OpStore %8 %50
+ OpBranch %34
+ %34 = OpLabel
+ %51 = OpLoad %15 %21
+ %52 = OpIAdd %15 %51 %27
+ OpStore %21 %52
+ OpBranch %31
+ %33 = OpLabel
+ %54 = OpAccessChain %17 %14 %16 %53
+ %55 = OpLoad %6 %54
+ %56 = OpLoad %6 %8
+ %57 = OpFOrdLessThan %39 %55 %56
+ OpSelectionMerge %59 None
+ OpBranchConditional %57 %58 %59
+ %58 = OpLabel
+ %60 = OpLoad %6 %8
+ %62 = OpAccessChain %17 %14 %16 %61
+ %63 = OpLoad %6 %62
+ %64 = OpFOrdLessThan %39 %60 %63
+ OpBranch %59
+ %59 = OpLabel
+ %65 = OpPhi %39 %57 %33 %64 %58
+ OpSelectionMerge %67 None
+ OpBranchConditional %65 %66 %84
+ %66 = OpLabel
+ %71 = OpAccessChain %28 %26 %16 %53
+ %72 = OpLoad %15 %71
+ %73 = OpConvertSToF %6 %72
+ %74 = OpAccessChain %28 %26 %16 %27
+ %75 = OpLoad %15 %74
+ %76 = OpConvertSToF %6 %75
+ %77 = OpAccessChain %28 %26 %16 %27
+ %78 = OpLoad %15 %77
+ %79 = OpConvertSToF %6 %78
+ %80 = OpAccessChain %28 %26 %16 %53
+ %81 = OpLoad %15 %80
+ %82 = OpConvertSToF %6 %81
+ %83 = OpCompositeConstruct %68 %73 %76 %79 %82
+ OpStore %70 %83
+ OpBranch %67
+ %84 = OpLabel
+ %85 = OpAccessChain %28 %26 %16 %27
+ %86 = OpLoad %15 %85
+ %87 = OpConvertSToF %6 %86
+ %88 = OpCompositeConstruct %68 %87 %87 %87 %87
+ OpStore %70 %88
+ OpBranch %67
+ %67 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.25 1.0 0.281 0.282
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 instruction combining 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 310 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [10, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[3];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int count = _int_0;
+# for (int i = _int_0; i < _int_10; i++)
+# {
+# // Always false.
+# if (count % -93448 > _int_0)
+# {
+# count++;
+# }
+# }
+# if (count == _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; 8
+; Bound: 74
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %54
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "count"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %20 "i"
+ 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 %54 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
+ %31 = OpTypeBool
+ %34 = OpConstant %6 -93448
+ %51 = OpTypeFloat 32
+ %52 = OpTypeVector %51 4
+ %53 = OpTypePointer Output %52
+ %54 = OpVariable %53 Output
+ %55 = OpConstant %6 2
+ %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
+ %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
+ %29 = OpAccessChain %17 %14 %15 %15
+ %30 = OpLoad %6 %29
+ %32 = OpSLessThan %31 %28 %30
+ OpBranchConditional %32 %24 %25
+ %24 = OpLabel
+ %33 = OpLoad %6 %8
+ %35 = OpSMod %6 %33 %34
+ %36 = OpAccessChain %17 %14 %15 %16
+ %37 = OpLoad %6 %36
+ %38 = OpSGreaterThan %31 %35 %37
+ OpSelectionMerge %40 None
+ OpBranchConditional %38 %39 %40
+ %39 = OpLabel
+ %41 = OpLoad %6 %8
+ %42 = OpIAdd %6 %41 %16
+ OpStore %8 %42
+ OpBranch %40
+ %40 = OpLabel
+ OpBranch %26
+ %26 = OpLabel
+ %43 = OpLoad %6 %20
+ %44 = OpIAdd %6 %43 %16
+ OpStore %20 %44
+ OpBranch %23
+ %25 = OpLabel
+ %45 = OpLoad %6 %8
+ %46 = OpAccessChain %17 %14 %15 %16
+ %47 = OpLoad %6 %46
+ %48 = OpIEqual %31 %45 %47
+ OpSelectionMerge %50 None
+ OpBranchConditional %48 %49 %69
+ %49 = OpLabel
+ %56 = OpAccessChain %17 %14 %15 %55
+ %57 = OpLoad %6 %56
+ %58 = OpConvertSToF %51 %57
+ %59 = OpAccessChain %17 %14 %15 %16
+ %60 = OpLoad %6 %59
+ %61 = OpConvertSToF %51 %60
+ %62 = OpAccessChain %17 %14 %15 %16
+ %63 = OpLoad %6 %62
+ %64 = OpConvertSToF %51 %63
+ %65 = OpAccessChain %17 %14 %15 %55
+ %66 = OpLoad %6 %65
+ %67 = OpConvertSToF %51 %66
+ %68 = OpCompositeConstruct %52 %58 %61 %64 %67
+ OpStore %54 %68
+ OpBranch %50
+ %69 = OpLabel
+ %70 = OpAccessChain %17 %14 %15 %16
+ %71 = OpLoad %6 %70
+ %72 = OpConvertSToF %51 %71
+ %73 = OpCompositeConstruct %52 %72 %72 %72 %72
+ OpStore %54 %73
+ OpBranch %50
+ %50 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 0 1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific machine basic block 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_5 _GLF_uniform_int_values[1]
+# #define _int_4 _GLF_uniform_int_values[2]
+# #define _int_3 _GLF_uniform_int_values[3]
+# #define _int_2 _GLF_uniform_int_values[4]
+# #define _int_0 _GLF_uniform_int_values[5]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+#
+# precision highp int;
+# precision highp float;
+#
+# // 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, 5, 4, 3, 2, 0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[6];
+# };
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+# int data[5] = int[5](_int_5, _int_4, _int_3, _int_2, _int_1);
+#
+# for (int a = _int_0; a < _int_1; a++)
+# {
+# for (int i = _int_0; i < _int_5; i++)
+# {
+# for (int j = i; j < _int_5; j++)
+# {
+# if (data[i] < data[j])
+# {
+# _GLF_color = vec4(_int_0);
+# }
+# }
+# }
+# }
+#
+# // Always false.
+# while (gl_FragCoord.x < _float_0_0)
+# {
+# for (int i = _int_0; i < _int_1; 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: 146
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9 %114
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "_GLF_color"
+ OpName %14 "buf1"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpName %36 "data"
+ OpName %53 "a"
+ OpName %66 "i"
+ OpName %78 "j"
+ OpName %114 "gl_FragCoord"
+ OpName %121 "buf0"
+ OpMemberName %121 0 "_GLF_uniform_float_values"
+ OpName %123 ""
+ OpName %128 "i"
+ OpDecorate %9 Location 0
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 1
+ OpDecorate %114 BuiltIn FragCoord
+ OpDecorate %120 ArrayStride 16
+ OpMemberDecorate %121 0 Offset 0
+ OpDecorate %121 Block
+ OpDecorate %123 DescriptorSet 0
+ OpDecorate %123 Binding 0
+ %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 6
+ %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 5
+ %33 = OpConstant %11 5
+ %34 = OpTypeArray %10 %33
+ %35 = OpTypePointer Function %34
+ %37 = OpConstant %10 1
+ %40 = OpConstant %10 2
+ %43 = OpConstant %10 3
+ %46 = OpConstant %10 4
+ %52 = OpTypePointer Function %10
+ %64 = OpTypeBool
+ %113 = OpTypePointer Input %7
+ %114 = OpVariable %113 Input
+ %115 = OpConstant %11 0
+ %116 = OpTypePointer Input %6
+ %119 = OpConstant %11 1
+ %120 = OpTypeArray %6 %119
+ %121 = OpTypeStruct %120
+ %122 = OpTypePointer Uniform %121
+ %123 = OpVariable %122 Uniform
+ %124 = OpTypePointer Uniform %6
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %36 = OpVariable %35 Function
+ %53 = OpVariable %52 Function
+ %66 = OpVariable %52 Function
+ %78 = OpVariable %52 Function
+ %128 = OpVariable %52 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
+ %29 = OpAccessChain %18 %16 %17 %17
+ %30 = OpLoad %10 %29
+ %31 = OpConvertSToF %6 %30
+ %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+ OpStore %9 %32
+ %38 = OpAccessChain %18 %16 %17 %37
+ %39 = OpLoad %10 %38
+ %41 = OpAccessChain %18 %16 %17 %40
+ %42 = OpLoad %10 %41
+ %44 = OpAccessChain %18 %16 %17 %43
+ %45 = OpLoad %10 %44
+ %47 = OpAccessChain %18 %16 %17 %46
+ %48 = OpLoad %10 %47
+ %49 = OpAccessChain %18 %16 %17 %17
+ %50 = OpLoad %10 %49
+ %51 = OpCompositeConstruct %34 %39 %42 %45 %48 %50
+ OpStore %36 %51
+ %54 = OpAccessChain %18 %16 %17 %22
+ %55 = OpLoad %10 %54
+ OpStore %53 %55
+ OpBranch %56
+ %56 = OpLabel
+ OpLoopMerge %58 %59 None
+ OpBranch %60
+ %60 = OpLabel
+ %61 = OpLoad %10 %53
+ %62 = OpAccessChain %18 %16 %17 %17
+ %63 = OpLoad %10 %62
+ %65 = OpSLessThan %64 %61 %63
+ OpBranchConditional %65 %57 %58
+ %57 = OpLabel
+ %67 = OpAccessChain %18 %16 %17 %22
+ %68 = OpLoad %10 %67
+ OpStore %66 %68
+ OpBranch %69
+ %69 = OpLabel
+ OpLoopMerge %71 %72 None
+ OpBranch %73
+ %73 = OpLabel
+ %74 = OpLoad %10 %66
+ %75 = OpAccessChain %18 %16 %17 %37
+ %76 = OpLoad %10 %75
+ %77 = OpSLessThan %64 %74 %76
+ OpBranchConditional %77 %70 %71
+ %70 = OpLabel
+ %79 = OpLoad %10 %66
+ OpStore %78 %79
+ OpBranch %80
+ %80 = OpLabel
+ OpLoopMerge %82 %83 None
+ OpBranch %84
+ %84 = OpLabel
+ %85 = OpLoad %10 %78
+ %86 = OpAccessChain %18 %16 %17 %37
+ %87 = OpLoad %10 %86
+ %88 = OpSLessThan %64 %85 %87
+ OpBranchConditional %88 %81 %82
+ %81 = OpLabel
+ %89 = OpLoad %10 %66
+ %90 = OpAccessChain %52 %36 %89
+ %91 = OpLoad %10 %90
+ %92 = OpLoad %10 %78
+ %93 = OpAccessChain %52 %36 %92
+ %94 = OpLoad %10 %93
+ %95 = OpSLessThan %64 %91 %94
+ OpSelectionMerge %97 None
+ OpBranchConditional %95 %96 %97
+ %96 = OpLabel
+ %98 = OpAccessChain %18 %16 %17 %22
+ %99 = OpLoad %10 %98
+ %100 = OpConvertSToF %6 %99
+ %101 = OpCompositeConstruct %7 %100 %100 %100 %100
+ OpStore %9 %101
+ OpBranch %97
+ %97 = OpLabel
+ OpBranch %83
+ %83 = OpLabel
+ %102 = OpLoad %10 %78
+ %103 = OpIAdd %10 %102 %37
+ OpStore %78 %103
+ OpBranch %80
+ %82 = OpLabel
+ OpBranch %72
+ %72 = OpLabel
+ %104 = OpLoad %10 %66
+ %105 = OpIAdd %10 %104 %37
+ OpStore %66 %105
+ OpBranch %69
+ %71 = OpLabel
+ OpBranch %59
+ %59 = OpLabel
+ %106 = OpLoad %10 %53
+ %107 = OpIAdd %10 %106 %37
+ OpStore %53 %107
+ OpBranch %56
+ %58 = OpLabel
+ OpBranch %108
+ %108 = OpLabel
+ OpLoopMerge %110 %111 None
+ OpBranch %112
+ %112 = OpLabel
+ %117 = OpAccessChain %116 %114 %115
+ %118 = OpLoad %6 %117
+ %125 = OpAccessChain %124 %123 %17 %17
+ %126 = OpLoad %6 %125
+ %127 = OpFOrdLessThan %64 %118 %126
+ OpBranchConditional %127 %109 %110
+ %109 = OpLabel
+ %129 = OpAccessChain %18 %16 %17 %22
+ %130 = OpLoad %10 %129
+ OpStore %128 %130
+ OpBranch %131
+ %131 = OpLabel
+ OpLoopMerge %133 %134 None
+ OpBranch %135
+ %135 = OpLabel
+ %136 = OpLoad %10 %128
+ %137 = OpAccessChain %18 %16 %17 %17
+ %138 = OpLoad %10 %137
+ %139 = OpSLessThan %64 %136 %138
+ OpBranchConditional %139 %132 %133
+ %132 = OpLabel
+ %140 = OpAccessChain %18 %16 %17 %22
+ %141 = OpLoad %10 %140
+ %142 = OpConvertSToF %6 %141
+ %143 = OpCompositeConstruct %7 %142 %142 %142 %142
+ OpStore %9 %143
+ OpBranch %134
+ %134 = OpLabel
+ %144 = OpLoad %10 %128
+ %145 = OpIAdd %10 %144 %37
+ OpStore %128 %145
+ OpBranch %131
+ %133 = OpLabel
+ OpBranch %111
+ %111 = OpLabel
+ OpBranch %108
+ %110 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1 5 4 3 2 0
+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 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 calculates modulo of an acosh result
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _float_2_6 _GLF_uniform_float_values[0]
+# #define _float_1_61 _GLF_uniform_float_values[1]
+# #define _float_0_1 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [2.6, 1.61, 0.1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float f = mod(acosh(_float_2_6), 7938.0);
+# if (abs(f - _float_1_61) < _float_0_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; 8
+; Bound: 63
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %38
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "f"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %38 "_GLF_color"
+ OpName %41 "buf1"
+ OpMemberName %41 0 "_GLF_uniform_int_values"
+ OpName %43 ""
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %38 Location 0
+ OpDecorate %40 ArrayStride 16
+ OpMemberDecorate %41 0 Offset 0
+ OpDecorate %41 Block
+ OpDecorate %43 DescriptorSet 0
+ OpDecorate %43 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %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 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpTypePointer Uniform %6
+ %21 = OpConstant %6 7938
+ %24 = OpConstant %15 1
+ %29 = OpConstant %15 2
+ %32 = OpTypeBool
+ %36 = OpTypeVector %6 4
+ %37 = OpTypePointer Output %36
+ %38 = OpVariable %37 Output
+ %39 = OpConstant %9 2
+ %40 = OpTypeArray %15 %39
+ %41 = OpTypeStruct %40
+ %42 = OpTypePointer Uniform %41
+ %43 = OpVariable %42 Uniform
+ %44 = OpTypePointer Uniform %15
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %16 %16
+ %19 = OpLoad %6 %18
+ %20 = OpExtInst %6 %1 Acosh %19
+ %22 = OpFMod %6 %20 %21
+ OpStore %8 %22
+ %23 = OpLoad %6 %8
+ %25 = OpAccessChain %17 %14 %16 %24
+ %26 = OpLoad %6 %25
+ %27 = OpFSub %6 %23 %26
+ %28 = OpExtInst %6 %1 FAbs %27
+ %30 = OpAccessChain %17 %14 %16 %29
+ %31 = OpLoad %6 %30
+ %33 = OpFOrdLessThan %32 %28 %31
+ OpSelectionMerge %35 None
+ OpBranchConditional %33 %34 %58
+ %34 = OpLabel
+ %45 = OpAccessChain %44 %43 %16 %24
+ %46 = OpLoad %15 %45
+ %47 = OpConvertSToF %6 %46
+ %48 = OpAccessChain %44 %43 %16 %16
+ %49 = OpLoad %15 %48
+ %50 = OpConvertSToF %6 %49
+ %51 = OpAccessChain %44 %43 %16 %16
+ %52 = OpLoad %15 %51
+ %53 = OpConvertSToF %6 %52
+ %54 = OpAccessChain %44 %43 %16 %24
+ %55 = OpLoad %15 %54
+ %56 = OpConvertSToF %6 %55
+ %57 = OpCompositeConstruct %36 %47 %50 %53 %56
+ OpStore %38 %57
+ OpBranch %35
+ %58 = OpLabel
+ %59 = OpAccessChain %44 %43 %16 %16
+ %60 = OpLoad %15 %59
+ %61 = OpConvertSToF %6 %60
+ %62 = OpCompositeConstruct %36 %61 %61 %61 %61
+ OpStore %38 %62
+ OpBranch %35
+ %35 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 2.6 1.61 0.1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific live intervals code path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _int_10 _GLF_uniform_int_values[3]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_2_0 _GLF_uniform_float_values[1]
+# #define _float_0_0 _GLF_uniform_float_values[2]
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [0, 2, 1, 10]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 2.0, 0.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float a = _float_1_0;
+#
+# // b becomes 0.
+# int b = int(modf(_float_0_0, a));
+#
+# vec2 v1 = vec2(_float_1_0);
+#
+# // Always true.
+# if (v1[clamp(_int_0, b, _int_2)] >= _float_1_0)
+# {
+# float c = _float_2_0;
+# for (int i = _int_0; (c >= _float_2_0) && (i < _int_10); i++)
+# {
+# a = c;
+# c = a;
+# }
+# }
+# if (a == _float_2_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: 108
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %89
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf1"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %21 "b"
+ OpName %29 "v1"
+ OpName %35 "buf0"
+ OpMemberName %35 0 "_GLF_uniform_int_values"
+ OpName %37 ""
+ OpName %54 "c"
+ OpName %57 "i"
+ OpName %89 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 1
+ OpDecorate %34 ArrayStride 16
+ OpMemberDecorate %35 0 Offset 0
+ OpDecorate %35 Block
+ OpDecorate %37 DescriptorSet 0
+ OpDecorate %37 Binding 0
+ OpDecorate %89 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %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 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpTypePointer Uniform %6
+ %20 = OpTypePointer Function %15
+ %22 = OpConstant %15 2
+ %27 = OpTypeVector %6 2
+ %28 = OpTypePointer Function %27
+ %33 = OpConstant %9 4
+ %34 = OpTypeArray %15 %33
+ %35 = OpTypeStruct %34
+ %36 = OpTypePointer Uniform %35
+ %37 = OpVariable %36 Uniform
+ %38 = OpTypePointer Uniform %15
+ %42 = OpConstant %15 1
+ %50 = OpTypeBool
+ %72 = OpConstant %15 3
+ %87 = OpTypeVector %6 4
+ %88 = OpTypePointer Output %87
+ %89 = OpVariable %88 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %21 = OpVariable %20 Function
+ %29 = OpVariable %28 Function
+ %54 = OpVariable %7 Function
+ %57 = OpVariable %20 Function
+ %18 = OpAccessChain %17 %14 %16 %16
+ %19 = OpLoad %6 %18
+ OpStore %8 %19
+ %23 = OpAccessChain %17 %14 %16 %22
+ %24 = OpLoad %6 %23
+ %25 = OpExtInst %6 %1 Modf %24 %8
+ %26 = OpConvertFToS %15 %25
+ OpStore %21 %26
+ %30 = OpAccessChain %17 %14 %16 %16
+ %31 = OpLoad %6 %30
+ %32 = OpCompositeConstruct %27 %31 %31
+ OpStore %29 %32
+ %39 = OpAccessChain %38 %37 %16 %16
+ %40 = OpLoad %15 %39
+ %41 = OpLoad %15 %21
+ %43 = OpAccessChain %38 %37 %16 %42
+ %44 = OpLoad %15 %43
+ %45 = OpExtInst %15 %1 SClamp %40 %41 %44
+ %46 = OpAccessChain %7 %29 %45
+ %47 = OpLoad %6 %46
+ %48 = OpAccessChain %17 %14 %16 %16
+ %49 = OpLoad %6 %48
+ %51 = OpFOrdGreaterThanEqual %50 %47 %49
+ OpSelectionMerge %53 None
+ OpBranchConditional %51 %52 %53
+ %52 = OpLabel
+ %55 = OpAccessChain %17 %14 %16 %42
+ %56 = OpLoad %6 %55
+ OpStore %54 %56
+ %58 = OpAccessChain %38 %37 %16 %16
+ %59 = OpLoad %15 %58
+ OpStore %57 %59
+ OpBranch %60
+ %60 = OpLabel
+ OpLoopMerge %62 %63 None
+ OpBranch %64
+ %64 = OpLabel
+ %65 = OpLoad %6 %54
+ %66 = OpAccessChain %17 %14 %16 %42
+ %67 = OpLoad %6 %66
+ %68 = OpFOrdGreaterThanEqual %50 %65 %67
+ OpSelectionMerge %70 None
+ OpBranchConditional %68 %69 %70
+ %69 = OpLabel
+ %71 = OpLoad %15 %57
+ %73 = OpAccessChain %38 %37 %16 %72
+ %74 = OpLoad %15 %73
+ %75 = OpSLessThan %50 %71 %74
+ OpBranch %70
+ %70 = OpLabel
+ %76 = OpPhi %50 %68 %64 %75 %69
+ OpBranchConditional %76 %61 %62
+ %61 = OpLabel
+ %77 = OpLoad %6 %54
+ OpStore %8 %77
+ %78 = OpLoad %6 %8
+ OpStore %54 %78
+ OpBranch %63
+ %63 = OpLabel
+ %79 = OpLoad %15 %57
+ %80 = OpIAdd %15 %79 %42
+ OpStore %57 %80
+ OpBranch %60
+ %62 = OpLabel
+ OpBranch %53
+ %53 = OpLabel
+ %81 = OpLoad %6 %8
+ %82 = OpAccessChain %17 %14 %16 %42
+ %83 = OpLoad %6 %82
+ %84 = OpFOrdEqual %50 %81 %83
+ OpSelectionMerge %86 None
+ OpBranchConditional %84 %85 %103
+ %85 = OpLabel
+ %90 = OpAccessChain %38 %37 %16 %22
+ %91 = OpLoad %15 %90
+ %92 = OpConvertSToF %6 %91
+ %93 = OpAccessChain %38 %37 %16 %16
+ %94 = OpLoad %15 %93
+ %95 = OpConvertSToF %6 %94
+ %96 = OpAccessChain %38 %37 %16 %16
+ %97 = OpLoad %15 %96
+ %98 = OpConvertSToF %6 %97
+ %99 = OpAccessChain %38 %37 %16 %22
+ %100 = OpLoad %15 %99
+ %101 = OpConvertSToF %6 %100
+ %102 = OpCompositeConstruct %87 %92 %95 %98 %101
+ OpStore %89 %102
+ OpBranch %86
+ %103 = OpLabel
+ %104 = OpAccessChain %38 %37 %16 %16
+ %105 = OpLoad %15 %104
+ %106 = OpConvertSToF %6 %105
+ %107 = OpCompositeConstruct %87 %106 %106 %106 %106
+ OpStore %89 %107
+ OpBranch %86
+ %86 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 2.0 0.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 2 1 10
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific selection dag code path
+
+# 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 310 es
+# #define _int_3 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+# #define _float_10_0 _GLF_uniform_float_values[0]
+# #define _float_1_0 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+# #define _float_3_0 _GLF_uniform_float_values[3]
+# #define _float_4_0 _GLF_uniform_float_values[4]
+#
+# precision highp int;
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [10.0, 1.0, 2.0, 3.0, 4.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[5];
+# };
+#
+# // Contents of _GLF_uniform_int_values: [3, 0, 1]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# mat2 M1 = mat2(_float_1_0, _float_2_0, _float_3_0, _float_4_0);
+# float a = _float_1_0;
+#
+# for (int c = _int_0; c < _int_3; c++)
+# {
+# // At each iteration, clamp returns 0.
+# a += M1[_int_1][clamp(~c, 0, 1)];
+# }
+#
+# if (a == _float_10_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_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: 99
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %80
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %10 "M1"
+ OpName %14 "buf0"
+ OpMemberName %14 0 "_GLF_uniform_float_values"
+ OpName %16 ""
+ OpName %38 "a"
+ OpName %42 "c"
+ OpName %45 "buf1"
+ OpMemberName %45 0 "_GLF_uniform_int_values"
+ OpName %47 ""
+ OpName %80 "_GLF_color"
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 0
+ OpDecorate %44 ArrayStride 16
+ OpMemberDecorate %45 0 Offset 0
+ OpDecorate %45 Block
+ OpDecorate %47 DescriptorSet 0
+ OpDecorate %47 Binding 1
+ OpDecorate %80 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypeMatrix %7 2
+ %9 = OpTypePointer Function %8
+ %11 = OpTypeInt 32 0
+ %12 = OpConstant %11 5
+ %13 = OpTypeArray %6 %12
+ %14 = OpTypeStruct %13
+ %15 = OpTypePointer Uniform %14
+ %16 = OpVariable %15 Uniform
+ %17 = OpTypeInt 32 1
+ %18 = OpConstant %17 0
+ %19 = OpConstant %17 1
+ %20 = OpTypePointer Uniform %6
+ %23 = OpConstant %17 2
+ %26 = OpConstant %17 3
+ %29 = OpConstant %17 4
+ %32 = OpConstant %6 1
+ %33 = OpConstant %6 0
+ %37 = OpTypePointer Function %6
+ %41 = OpTypePointer Function %17
+ %43 = OpConstant %11 3
+ %44 = OpTypeArray %17 %43
+ %45 = OpTypeStruct %44
+ %46 = OpTypePointer Uniform %45
+ %47 = OpVariable %46 Uniform
+ %48 = OpTypePointer Uniform %17
+ %59 = OpTypeBool
+ %78 = OpTypeVector %6 4
+ %79 = OpTypePointer Output %78
+ %80 = OpVariable %79 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %10 = OpVariable %9 Function
+ %38 = OpVariable %37 Function
+ %42 = OpVariable %41 Function
+ %21 = OpAccessChain %20 %16 %18 %19
+ %22 = OpLoad %6 %21
+ %24 = OpAccessChain %20 %16 %18 %23
+ %25 = OpLoad %6 %24
+ %27 = OpAccessChain %20 %16 %18 %26
+ %28 = OpLoad %6 %27
+ %30 = OpAccessChain %20 %16 %18 %29
+ %31 = OpLoad %6 %30
+ %34 = OpCompositeConstruct %7 %22 %25
+ %35 = OpCompositeConstruct %7 %28 %31
+ %36 = OpCompositeConstruct %8 %34 %35
+ OpStore %10 %36
+ %39 = OpAccessChain %20 %16 %18 %19
+ %40 = OpLoad %6 %39
+ OpStore %38 %40
+ %49 = OpAccessChain %48 %47 %18 %19
+ %50 = OpLoad %17 %49
+ OpStore %42 %50
+ OpBranch %51
+ %51 = OpLabel
+ OpLoopMerge %53 %54 None
+ OpBranch %55
+ %55 = OpLabel
+ %56 = OpLoad %17 %42
+ %57 = OpAccessChain %48 %47 %18 %18
+ %58 = OpLoad %17 %57
+ %60 = OpSLessThan %59 %56 %58
+ OpBranchConditional %60 %52 %53
+ %52 = OpLabel
+ %61 = OpAccessChain %48 %47 %18 %23
+ %62 = OpLoad %17 %61
+ %63 = OpLoad %17 %42
+ %64 = OpNot %17 %63
+ %65 = OpExtInst %17 %1 SClamp %64 %18 %19
+ %66 = OpAccessChain %37 %10 %62 %65
+ %67 = OpLoad %6 %66
+ %68 = OpLoad %6 %38
+ %69 = OpFAdd %6 %68 %67
+ OpStore %38 %69
+ OpBranch %54
+ %54 = OpLabel
+ %70 = OpLoad %17 %42
+ %71 = OpIAdd %17 %70 %19
+ OpStore %42 %71
+ OpBranch %51
+ %53 = OpLabel
+ %72 = OpLoad %6 %38
+ %73 = OpAccessChain %20 %16 %18 %18
+ %74 = OpLoad %6 %73
+ %75 = OpFOrdEqual %59 %72 %74
+ OpSelectionMerge %77 None
+ OpBranchConditional %75 %76 %94
+ %76 = OpLabel
+ %81 = OpAccessChain %48 %47 %18 %23
+ %82 = OpLoad %17 %81
+ %83 = OpConvertSToF %6 %82
+ %84 = OpAccessChain %48 %47 %18 %19
+ %85 = OpLoad %17 %84
+ %86 = OpConvertSToF %6 %85
+ %87 = OpAccessChain %48 %47 %18 %19
+ %88 = OpLoad %17 %87
+ %89 = OpConvertSToF %6 %88
+ %90 = OpAccessChain %48 %47 %18 %23
+ %91 = OpLoad %17 %90
+ %92 = OpConvertSToF %6 %91
+ %93 = OpCompositeConstruct %78 %83 %86 %89 %92
+ OpStore %80 %93
+ OpBranch %77
+ %94 = OpLabel
+ %95 = OpAccessChain %48 %47 %18 %23
+ %96 = OpLoad %17 %95
+ %97 = OpConvertSToF %6 %96
+ %98 = OpCompositeConstruct %78 %97 %97 %97 %97
+ OpStore %80 %98
+ OpBranch %77
+ %77 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 3 0 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 10.0 1.0 2.0 3.0 4.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific simplify cfg code path
+
+# 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 310 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 buf1
+# {
+# int _GLF_uniform_int_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+#
+# // Always false.
+# if(_int_0 > _int_1)
+# {
+# do
+# {
+# _GLF_color = vec4(_int_1);
+# }
+# while(_int_0 > _int_1);
+#
+# return;
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 10
+; Bound: 55
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %9
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "_GLF_color"
+ OpName %14 "buf1"
+ OpMemberName %14 0 "_GLF_uniform_int_values"
+ OpName %16 ""
+ OpDecorate %9 Location 0
+ OpDecorate %13 ArrayStride 16
+ OpMemberDecorate %14 0 Offset 0
+ OpDecorate %14 Block
+ OpDecorate %16 DescriptorSet 0
+ OpDecorate %16 Binding 0
+ %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
+ %37 = OpTypeBool
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %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
+ %29 = OpAccessChain %18 %16 %17 %17
+ %30 = OpLoad %10 %29
+ %31 = OpConvertSToF %6 %30
+ %32 = OpCompositeConstruct %7 %21 %25 %28 %31
+ OpStore %9 %32
+ %33 = OpAccessChain %18 %16 %17 %22
+ %34 = OpLoad %10 %33
+ %35 = OpAccessChain %18 %16 %17 %17
+ %36 = OpLoad %10 %35
+ %38 = OpSGreaterThan %37 %34 %36
+ OpSelectionMerge %40 None
+ OpBranchConditional %38 %39 %40
+ %39 = OpLabel
+ OpBranch %41
+ %41 = OpLabel
+ OpLoopMerge %43 %44 None
+ OpBranch %42
+ %42 = OpLabel
+ %45 = OpAccessChain %18 %16 %17 %17
+ %46 = OpLoad %10 %45
+ %47 = OpConvertSToF %6 %46
+ %48 = OpCompositeConstruct %7 %47 %47 %47 %47
+ OpStore %9 %48
+ OpBranch %44
+ %44 = OpLabel
+ %49 = OpAccessChain %18 %16 %17 %22
+ %50 = OpLoad %10 %49
+ %51 = OpAccessChain %18 %16 %17 %17
+ %52 = OpLoad %10 %51
+ %53 = OpSGreaterThan %37 %50 %52
+ OpBranchConditional %53 %41 %43
+ %43 = OpLabel
+ OpReturn
+ %40 = 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 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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: Covers a specific schedule dag register reduction list code path
+
+# 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 310 es
+# #define _float_0_0446 _GLF_uniform_float_values[0]
+# #define _float_0_0448 _GLF_uniform_float_values[1]
+# #define _float_4_6 _GLF_uniform_float_values[2]
+# #define _float_1_0 _GLF_uniform_float_values[3]
+# #define _float_0_0 _GLF_uniform_float_values[4]
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_float_values: [0.0446, 0.0448, 4.6, 1.0, 0.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // a becomes 4.6.
+# float a = mix(_float_4_6, _float_1_0, _float_1_0 > _float_4_6);
+#
+# float b = cos(log(a));
+#
+# _GLF_color = vec4(b);
+#
+# if (b > _float_0_0446 && b < _float_0_0448)
+# {
+# _GLF_color = vec4(_float_1_0, _float_0_0, _float_0_0, _float_1_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: 64
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %37
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %31 "b"
+ OpName %37 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %37 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 5
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpConstant %15 2
+ %18 = OpTypePointer Uniform %6
+ %21 = OpConstant %15 3
+ %28 = OpTypeBool
+ %35 = OpTypeVector %6 4
+ %36 = OpTypePointer Output %35
+ %37 = OpVariable %36 Output
+ %47 = OpConstant %15 1
+ %56 = OpConstant %15 4
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %31 = OpVariable %7 Function
+ %19 = OpAccessChain %18 %14 %16 %17
+ %20 = OpLoad %6 %19
+ %22 = OpAccessChain %18 %14 %16 %21
+ %23 = OpLoad %6 %22
+ %24 = OpAccessChain %18 %14 %16 %21
+ %25 = OpLoad %6 %24
+ %26 = OpAccessChain %18 %14 %16 %17
+ %27 = OpLoad %6 %26
+ %29 = OpFOrdGreaterThan %28 %25 %27
+ %30 = OpSelect %6 %29 %23 %20
+ OpStore %8 %30
+ %32 = OpLoad %6 %8
+ %33 = OpExtInst %6 %1 Log %32
+ %34 = OpExtInst %6 %1 Cos %33
+ OpStore %31 %34
+ %38 = OpLoad %6 %31
+ %39 = OpCompositeConstruct %35 %38 %38 %38 %38
+ OpStore %37 %39
+ %40 = OpLoad %6 %31
+ %41 = OpAccessChain %18 %14 %16 %16
+ %42 = OpLoad %6 %41
+ %43 = OpFOrdGreaterThan %28 %40 %42
+ OpSelectionMerge %45 None
+ OpBranchConditional %43 %44 %45
+ %44 = OpLabel
+ %46 = OpLoad %6 %31
+ %48 = OpAccessChain %18 %14 %16 %47
+ %49 = OpLoad %6 %48
+ %50 = OpFOrdLessThan %28 %46 %49
+ OpBranch %45
+ %45 = OpLabel
+ %51 = OpPhi %28 %43 %5 %50 %44
+ OpSelectionMerge %53 None
+ OpBranchConditional %51 %52 %53
+ %52 = OpLabel
+ %54 = OpAccessChain %18 %14 %16 %21
+ %55 = OpLoad %6 %54
+ %57 = OpAccessChain %18 %14 %16 %56
+ %58 = OpLoad %6 %57
+ %59 = OpAccessChain %18 %14 %16 %56
+ %60 = OpLoad %6 %59
+ %61 = OpAccessChain %18 %14 %16 %21
+ %62 = OpLoad %6 %61
+ %63 = OpCompositeConstruct %35 %55 %58 %60 %62
+ OpStore %37 %63
+ OpBranch %53
+ %53 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0446 0.0448 4.6 1.0 0.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific selection DAG code path
+
+# 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 310 es
+# #define _int_10 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_1 _GLF_uniform_int_values[2]
+#
+# precision highp int;
+#
+# precision highp float;
+#
+# // Contents of _GLF_uniform_int_values: [10, 0, 1]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int c = _int_1;
+#
+# for (int i = _int_1; i < _int_10; i++)
+# {
+# c = ~i;
+#
+# c = clamp(c, 0, 3);
+# }
+#
+# _GLF_color = vec4(_int_0);
+#
+# if (c == _int_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_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: 68
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %44
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "c"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %20 "i"
+ OpName %44 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %44 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 2
+ %17 = OpTypePointer Uniform %6
+ %31 = OpTypeBool
+ %36 = OpConstant %6 3
+ %39 = OpConstant %6 1
+ %41 = OpTypeFloat 32
+ %42 = OpTypeVector %41 4
+ %43 = OpTypePointer Output %42
+ %44 = OpVariable %43 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
+ %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
+ %29 = OpAccessChain %17 %14 %15 %15
+ %30 = OpLoad %6 %29
+ %32 = OpSLessThan %31 %28 %30
+ OpBranchConditional %32 %24 %25
+ %24 = OpLabel
+ %33 = OpLoad %6 %20
+ %34 = OpNot %6 %33
+ OpStore %8 %34
+ %35 = OpLoad %6 %8
+ %37 = OpExtInst %6 %1 SClamp %35 %15 %36
+ OpStore %8 %37
+ OpBranch %26
+ %26 = OpLabel
+ %38 = OpLoad %6 %20
+ %40 = OpIAdd %6 %38 %39
+ OpStore %20 %40
+ OpBranch %23
+ %25 = OpLabel
+ %45 = OpAccessChain %17 %14 %15 %39
+ %46 = OpLoad %6 %45
+ %47 = OpConvertSToF %41 %46
+ %48 = OpCompositeConstruct %42 %47 %47 %47 %47
+ OpStore %44 %48
+ %49 = OpLoad %6 %8
+ %50 = OpAccessChain %17 %14 %15 %39
+ %51 = OpLoad %6 %50
+ %52 = OpIEqual %31 %49 %51
+ OpSelectionMerge %54 None
+ OpBranchConditional %52 %53 %54
+ %53 = OpLabel
+ %55 = OpAccessChain %17 %14 %15 %16
+ %56 = OpLoad %6 %55
+ %57 = OpConvertSToF %41 %56
+ %58 = OpAccessChain %17 %14 %15 %39
+ %59 = OpLoad %6 %58
+ %60 = OpConvertSToF %41 %59
+ %61 = OpAccessChain %17 %14 %15 %39
+ %62 = OpLoad %6 %61
+ %63 = OpConvertSToF %41 %62
+ %64 = OpAccessChain %17 %14 %15 %16
+ %65 = OpLoad %6 %64
+ %66 = OpConvertSToF %41 %65
+ %67 = OpCompositeConstruct %42 %57 %60 %63 %66
+ OpStore %44 %67
+ OpBranch %54
+ %54 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 10 0 1
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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: Covers specific instruction simplifying and combining 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _int_5 _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()
+# {
+# int a = max(_int_1, max(_int_1, 1));
+# if (a == _int_1)
+# {
+# _GLF_color = vec4(a, _int_0, _int_0, a);
+# }
+# else
+# {
+# _GLF_color = vec4(a);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %34
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %34 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %34 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 = OpTypePointer Uniform %6
+ %21 = OpConstant %6 1
+ %27 = OpTypeBool
+ %31 = OpTypeFloat 32
+ %32 = OpTypeVector %31 4
+ %33 = OpTypePointer Output %32
+ %34 = OpVariable %33 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %17 = OpAccessChain %16 %14 %15 %15
+ %18 = OpLoad %6 %17
+ %19 = OpAccessChain %16 %14 %15 %15
+ %20 = OpLoad %6 %19
+ %22 = OpExtInst %6 %1 SMax %20 %21
+ %23 = OpExtInst %6 %1 SMax %18 %22
+ OpStore %8 %23
+ %24 = OpLoad %6 %8
+ %25 = OpAccessChain %16 %14 %15 %15
+ %26 = OpLoad %6 %25
+ %28 = OpIEqual %27 %24 %26
+ OpSelectionMerge %30 None
+ OpBranchConditional %28 %29 %46
+ %29 = OpLabel
+ %35 = OpLoad %6 %8
+ %36 = OpConvertSToF %31 %35
+ %37 = OpAccessChain %16 %14 %15 %21
+ %38 = OpLoad %6 %37
+ %39 = OpConvertSToF %31 %38
+ %40 = OpAccessChain %16 %14 %15 %21
+ %41 = OpLoad %6 %40
+ %42 = OpConvertSToF %31 %41
+ %43 = OpLoad %6 %8
+ %44 = OpConvertSToF %31 %43
+ %45 = OpCompositeConstruct %32 %36 %39 %42 %44
+ OpStore %34 %45
+ OpBranch %30
+ %46 = OpLabel
+ %47 = OpLoad %6 %8
+ %48 = OpConvertSToF %31 %47
+ %49 = OpCompositeConstruct %32 %48 %48 %48 %48
+ OpStore %34 %49
+ OpBranch %30
+ %30 = 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 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific instruction simplify code path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_2 _GLF_uniform_int_values[1]
+# #define _int_3 _GLF_uniform_int_values[2]
+# #define _int_1 _GLF_uniform_int_values[3]
+# #define _int_4 _GLF_uniform_int_values[4]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 2, 3, 1, 4]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[5];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# int A[4];
+# for (int i = _int_0; i < _int_4; i++)
+# {
+# A[i] = _int_0;
+#
+# // Sets the first two elements of A to 1.
+# if (max(2 * i, 2 * _int_1) == _int_2)
+# {
+# A[i] = 1;
+# }
+# }
+#
+# if (A[_int_0] == _int_1 && A[_int_1] == _int_1 && A[_int_2] == _int_0 &&
+# A[_int_3] == _int_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(1);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 115
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %98
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "i"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_int_values"
+ OpName %14 ""
+ OpName %33 "A"
+ OpName %98 "_GLF_color"
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %98 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeInt 32 1
+ %7 = OpTypePointer Function %6
+ %9 = OpTypeInt 32 0
+ %10 = OpConstant %9 5
+ %11 = OpTypeArray %6 %10
+ %12 = OpTypeStruct %11
+ %13 = OpTypePointer Uniform %12
+ %14 = OpVariable %13 Uniform
+ %15 = OpConstant %6 0
+ %16 = OpTypePointer Uniform %6
+ %25 = OpConstant %6 4
+ %28 = OpTypeBool
+ %30 = OpConstant %9 4
+ %31 = OpTypeArray %6 %30
+ %32 = OpTypePointer Function %31
+ %38 = OpConstant %6 2
+ %41 = OpConstant %6 3
+ %46 = OpConstant %6 1
+ %95 = OpTypeFloat 32
+ %96 = OpTypeVector %95 4
+ %97 = OpTypePointer Output %96
+ %98 = OpVariable %97 Output
+ %113 = OpConstant %95 1
+ %114 = OpConstantComposite %96 %113 %113 %113 %113
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %33 = OpVariable %32 Function
+ %17 = OpAccessChain %16 %14 %15 %15
+ %18 = OpLoad %6 %17
+ OpStore %8 %18
+ OpBranch %19
+ %19 = OpLabel
+ OpLoopMerge %21 %22 None
+ OpBranch %23
+ %23 = OpLabel
+ %24 = OpLoad %6 %8
+ %26 = OpAccessChain %16 %14 %15 %25
+ %27 = OpLoad %6 %26
+ %29 = OpSLessThan %28 %24 %27
+ OpBranchConditional %29 %20 %21
+ %20 = OpLabel
+ %34 = OpLoad %6 %8
+ %35 = OpAccessChain %16 %14 %15 %15
+ %36 = OpLoad %6 %35
+ %37 = OpAccessChain %7 %33 %34
+ OpStore %37 %36
+ %39 = OpLoad %6 %8
+ %40 = OpIMul %6 %38 %39
+ %42 = OpAccessChain %16 %14 %15 %41
+ %43 = OpLoad %6 %42
+ %44 = OpIMul %6 %38 %43
+ %45 = OpExtInst %6 %1 SMax %40 %44
+ %47 = OpAccessChain %16 %14 %15 %46
+ %48 = OpLoad %6 %47
+ %49 = OpIEqual %28 %45 %48
+ OpSelectionMerge %51 None
+ OpBranchConditional %49 %50 %51
+ %50 = OpLabel
+ %52 = OpLoad %6 %8
+ %53 = OpAccessChain %7 %33 %52
+ OpStore %53 %46
+ OpBranch %51
+ %51 = OpLabel
+ OpBranch %22
+ %22 = OpLabel
+ %54 = OpLoad %6 %8
+ %55 = OpIAdd %6 %54 %46
+ OpStore %8 %55
+ OpBranch %19
+ %21 = OpLabel
+ %56 = OpAccessChain %16 %14 %15 %15
+ %57 = OpLoad %6 %56
+ %58 = OpAccessChain %7 %33 %57
+ %59 = OpLoad %6 %58
+ %60 = OpAccessChain %16 %14 %15 %41
+ %61 = OpLoad %6 %60
+ %62 = OpIEqual %28 %59 %61
+ OpSelectionMerge %64 None
+ OpBranchConditional %62 %63 %64
+ %63 = OpLabel
+ %65 = OpAccessChain %16 %14 %15 %41
+ %66 = OpLoad %6 %65
+ %67 = OpAccessChain %7 %33 %66
+ %68 = OpLoad %6 %67
+ %69 = OpAccessChain %16 %14 %15 %41
+ %70 = OpLoad %6 %69
+ %71 = OpIEqual %28 %68 %70
+ OpBranch %64
+ %64 = OpLabel
+ %72 = OpPhi %28 %62 %21 %71 %63
+ OpSelectionMerge %74 None
+ OpBranchConditional %72 %73 %74
+ %73 = OpLabel
+ %75 = OpAccessChain %16 %14 %15 %46
+ %76 = OpLoad %6 %75
+ %77 = OpAccessChain %7 %33 %76
+ %78 = OpLoad %6 %77
+ %79 = OpAccessChain %16 %14 %15 %15
+ %80 = OpLoad %6 %79
+ %81 = OpIEqual %28 %78 %80
+ OpBranch %74
+ %74 = OpLabel
+ %82 = OpPhi %28 %72 %64 %81 %73
+ OpSelectionMerge %84 None
+ OpBranchConditional %82 %83 %84
+ %83 = OpLabel
+ %85 = OpAccessChain %16 %14 %15 %38
+ %86 = OpLoad %6 %85
+ %87 = OpAccessChain %7 %33 %86
+ %88 = OpLoad %6 %87
+ %89 = OpAccessChain %16 %14 %15 %15
+ %90 = OpLoad %6 %89
+ %91 = OpIEqual %28 %88 %90
+ OpBranch %84
+ %84 = OpLabel
+ %92 = OpPhi %28 %82 %74 %91 %83
+ OpSelectionMerge %94 None
+ OpBranchConditional %92 %93 %112
+ %93 = OpLabel
+ %99 = OpAccessChain %16 %14 %15 %41
+ %100 = OpLoad %6 %99
+ %101 = OpConvertSToF %95 %100
+ %102 = OpAccessChain %16 %14 %15 %15
+ %103 = OpLoad %6 %102
+ %104 = OpConvertSToF %95 %103
+ %105 = OpAccessChain %16 %14 %15 %15
+ %106 = OpLoad %6 %105
+ %107 = OpConvertSToF %95 %106
+ %108 = OpAccessChain %16 %14 %15 %41
+ %109 = OpLoad %6 %108
+ %110 = OpConvertSToF %95 %109
+ %111 = OpCompositeConstruct %96 %101 %104 %107 %110
+ OpStore %98 %111
+ OpBranch %94
+ %112 = OpLabel
+ OpStore %98 %114
+ OpBranch %94
+ %94 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 2 3 1 4
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific instruction simplification code path
+
+# 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[0]
+# #define _float_10_0 _GLF_uniform_float_values[0]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_float_values: [0.0, 10.0]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# // Contents of _GLF_uniform_int_values: 1
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# int _GLF_uniform_int_values[1];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float a = mod(_float_10_0, 1.);
+#
+# if (a == _float_0_0)
+# {
+# _GLF_color = vec4(_int_1, a, a, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(a);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %31
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %8 "a"
+ OpName %12 "buf0"
+ OpMemberName %12 0 "_GLF_uniform_float_values"
+ OpName %14 ""
+ OpName %31 "_GLF_color"
+ OpName %34 "buf1"
+ OpMemberName %34 0 "_GLF_uniform_int_values"
+ OpName %36 ""
+ OpDecorate %11 ArrayStride 16
+ OpMemberDecorate %12 0 Offset 0
+ OpDecorate %12 Block
+ OpDecorate %14 DescriptorSet 0
+ OpDecorate %14 Binding 0
+ OpDecorate %31 Location 0
+ OpDecorate %33 ArrayStride 16
+ OpMemberDecorate %34 0 Offset 0
+ OpDecorate %34 Block
+ OpDecorate %36 DescriptorSet 0
+ OpDecorate %36 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %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 = OpTypeInt 32 1
+ %16 = OpConstant %15 0
+ %17 = OpTypePointer Uniform %6
+ %20 = OpConstant %6 1
+ %25 = OpTypeBool
+ %29 = OpTypeVector %6 4
+ %30 = OpTypePointer Output %29
+ %31 = OpVariable %30 Output
+ %32 = OpConstant %9 1
+ %33 = OpTypeArray %15 %32
+ %34 = OpTypeStruct %33
+ %35 = OpTypePointer Uniform %34
+ %36 = OpVariable %35 Uniform
+ %37 = OpTypePointer Uniform %15
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %8 = OpVariable %7 Function
+ %18 = OpAccessChain %17 %14 %16 %16
+ %19 = OpLoad %6 %18
+ %21 = OpFMod %6 %19 %20
+ OpStore %8 %21
+ %22 = OpLoad %6 %8
+ %23 = OpAccessChain %17 %14 %16 %16
+ %24 = OpLoad %6 %23
+ %26 = OpFOrdEqual %25 %22 %24
+ OpSelectionMerge %28 None
+ OpBranchConditional %26 %27 %47
+ %27 = OpLabel
+ %38 = OpAccessChain %37 %36 %16 %16
+ %39 = OpLoad %15 %38
+ %40 = OpConvertSToF %6 %39
+ %41 = OpLoad %6 %8
+ %42 = OpLoad %6 %8
+ %43 = OpAccessChain %37 %36 %16 %16
+ %44 = OpLoad %15 %43
+ %45 = OpConvertSToF %6 %44
+ %46 = OpCompositeConstruct %29 %40 %41 %42 %45
+ OpStore %31 %46
+ OpBranch %28
+ %47 = OpLabel
+ %48 = OpLoad %6 %8
+ %49 = OpCompositeConstruct %29 %48 %48 %48 %48
+ OpStore %31 %49
+ OpBranch %28
+ %28 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 1
+END
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.0 10.0
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific X86 ISel lowering and AP Float 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 310 es
+# #define _int_1 _GLF_uniform_int_values[0]
+# #define _int_0 _GLF_uniform_int_values[1]
+# #define _float_0_54 _GLF_uniform_float_values[0]
+# #define _float_0_55 _GLF_uniform_float_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];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [0.54, 0.55]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[2];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# // uintbitstofloat(1) gives a very small denormalized value. The cos of this value
+# // should be very close to 1; perhaps marginally smaller. The cosine of *that* value
+# // should then be bounded below by 0.54, and might be slightly larger,
+# // so that 0.55 is a suitable upper bound.
+# vec2 v1 = cos(cos(intBitsToFloat(ivec2(-1, _int_1))));
+# _GLF_color = vec4(v1.x);
+#
+# if (v1.y > _float_0_54 && v1.y < _float_0_55)
+# {
+# _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; 8
+; Bound: 76
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %29
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %9 "v1"
+ OpName %15 "buf0"
+ OpMemberName %15 0 "_GLF_uniform_int_values"
+ OpName %17 ""
+ OpName %29 "_GLF_color"
+ OpName %40 "buf1"
+ OpMemberName %40 0 "_GLF_uniform_float_values"
+ OpName %42 ""
+ OpDecorate %14 ArrayStride 16
+ OpMemberDecorate %15 0 Offset 0
+ OpDecorate %15 Block
+ OpDecorate %17 DescriptorSet 0
+ OpDecorate %17 Binding 0
+ OpDecorate %29 Location 0
+ OpDecorate %39 ArrayStride 16
+ OpMemberDecorate %40 0 Offset 0
+ OpDecorate %40 Block
+ OpDecorate %42 DescriptorSet 0
+ OpDecorate %42 Binding 1
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeVector %6 2
+ %8 = OpTypePointer Function %7
+ %10 = OpTypeInt 32 1
+ %11 = OpConstant %10 -1
+ %12 = OpTypeInt 32 0
+ %13 = OpConstant %12 2
+ %14 = OpTypeArray %10 %13
+ %15 = OpTypeStruct %14
+ %16 = OpTypePointer Uniform %15
+ %17 = OpVariable %16 Uniform
+ %18 = OpConstant %10 0
+ %19 = OpTypePointer Uniform %10
+ %22 = OpTypeVector %10 2
+ %27 = OpTypeVector %6 4
+ %28 = OpTypePointer Output %27
+ %29 = OpVariable %28 Output
+ %30 = OpConstant %12 0
+ %31 = OpTypePointer Function %6
+ %35 = OpTypeBool
+ %36 = OpConstant %12 1
+ %39 = OpTypeArray %6 %13
+ %40 = OpTypeStruct %39
+ %41 = OpTypePointer Uniform %40
+ %42 = OpVariable %41 Uniform
+ %43 = OpTypePointer Uniform %6
+ %51 = OpConstant %10 1
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %9 = OpVariable %8 Function
+ %20 = OpAccessChain %19 %17 %18 %18
+ %21 = OpLoad %10 %20
+ %23 = OpCompositeConstruct %22 %11 %21
+ %24 = OpBitcast %7 %23
+ %25 = OpExtInst %7 %1 Cos %24
+ %26 = OpExtInst %7 %1 Cos %25
+ OpStore %9 %26
+ %32 = OpAccessChain %31 %9 %30
+ %33 = OpLoad %6 %32
+ %34 = OpCompositeConstruct %27 %33 %33 %33 %33
+ OpStore %29 %34
+ %37 = OpAccessChain %31 %9 %36
+ %38 = OpLoad %6 %37
+ %44 = OpAccessChain %43 %42 %18 %18
+ %45 = OpLoad %6 %44
+ %46 = OpFOrdGreaterThan %35 %38 %45
+ OpSelectionMerge %48 None
+ OpBranchConditional %46 %47 %48
+ %47 = OpLabel
+ %49 = OpAccessChain %31 %9 %36
+ %50 = OpLoad %6 %49
+ %52 = OpAccessChain %43 %42 %18 %51
+ %53 = OpLoad %6 %52
+ %54 = OpFOrdLessThan %35 %50 %53
+ OpBranch %48
+ %48 = OpLabel
+ %55 = OpPhi %35 %46 %5 %54 %47
+ OpSelectionMerge %57 None
+ OpBranchConditional %55 %56 %71
+ %56 = OpLabel
+ %58 = OpAccessChain %19 %17 %18 %18
+ %59 = OpLoad %10 %58
+ %60 = OpConvertSToF %6 %59
+ %61 = OpAccessChain %19 %17 %18 %51
+ %62 = OpLoad %10 %61
+ %63 = OpConvertSToF %6 %62
+ %64 = OpAccessChain %19 %17 %18 %51
+ %65 = OpLoad %10 %64
+ %66 = OpConvertSToF %6 %65
+ %67 = OpAccessChain %19 %17 %18 %18
+ %68 = OpLoad %10 %67
+ %69 = OpConvertSToF %6 %68
+ %70 = OpCompositeConstruct %27 %60 %63 %66 %69
+ OpStore %29 %70
+ OpBranch %57
+ %71 = OpLabel
+ %72 = OpAccessChain %19 %17 %18 %51
+ %73 = OpLoad %10 %72
+ %74 = OpConvertSToF %6 %73
+ %75 = OpCompositeConstruct %27 %74 %74 %74 %74
+ OpStore %29 %75
+ OpBranch %57
+ %57 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 0.54 0.55
+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 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
--- /dev/null
+#!amber
+
+# Copyright 2020 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 a specific X86 ISel lowering code path
+
+# 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 310 es
+# #define _int_0 _GLF_uniform_int_values[0]
+# #define _int_1 _GLF_uniform_int_values[1]
+# #define _int_4 _GLF_uniform_int_values[2]
+# #define _int_2 _GLF_uniform_int_values[3]
+# #define _float_1_0 _GLF_uniform_float_values[0]
+# #define _float_0_0 _GLF_uniform_float_values[1]
+# #define _float_2_0 _GLF_uniform_float_values[2]
+#
+# precision highp float;
+#
+# precision highp int;
+#
+# // Contents of _GLF_uniform_int_values: [0, 1, 4, 2]
+# layout(set = 0, binding = 0) uniform buf0
+# {
+# int _GLF_uniform_int_values[4];
+# };
+#
+# // Contents of _GLF_uniform_float_values: [1.0, 0.0, 2.0]
+# layout(set = 0, binding = 1) uniform buf1
+# {
+# float _GLF_uniform_float_values[3];
+# };
+#
+# layout(location = 0) out vec4 _GLF_color;
+#
+# void main()
+# {
+# float A[2];
+# A[0] = _float_0_0;
+# A[1] = _float_0_0;
+#
+# for (int i = _int_0; i < _int_2; i++)
+# {
+# for (int j = _int_0; j < _int_4; j++)
+# {
+# switch (j)
+# {
+# case 0:
+# // Undefined behavior but doesn't matter because the value will be
+# // overwritten in the next iteration.
+# if ((1 << -1) < i)
+# {
+# continue;
+# }
+# A[i] = _float_2_0;
+# break;
+# case 1:
+# A[i] = _float_1_0;
+# break;
+# }
+# }
+# }
+# if (A[_int_0] == _float_1_0 && A[_int_1] == _float_1_0)
+# {
+# _GLF_color = vec4(_int_1, _int_0, _int_0, _int_1);
+# }
+# else
+# {
+# _GLF_color = vec4(_int_1);
+# }
+# }
+SHADER fragment variant_fragment_shader SPIRV-ASM TARGET_ENV spv1.0
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 127
+; Schema: 0
+ OpCapability Shader
+ %1 = OpExtInstImport "GLSL.std.450"
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Fragment %4 "main" %108
+ OpExecutionMode %4 OriginUpperLeft
+ OpSource ESSL 310
+ OpName %4 "main"
+ OpName %11 "A"
+ OpName %16 "buf1"
+ OpMemberName %16 0 "_GLF_uniform_float_values"
+ OpName %18 ""
+ OpName %29 "i"
+ OpName %32 "buf0"
+ OpMemberName %32 0 "_GLF_uniform_int_values"
+ OpName %34 ""
+ OpName %49 "j"
+ OpName %108 "_GLF_color"
+ OpDecorate %15 ArrayStride 16
+ OpMemberDecorate %16 0 Offset 0
+ OpDecorate %16 Block
+ OpDecorate %18 DescriptorSet 0
+ OpDecorate %18 Binding 1
+ OpDecorate %31 ArrayStride 16
+ OpMemberDecorate %32 0 Offset 0
+ OpDecorate %32 Block
+ OpDecorate %34 DescriptorSet 0
+ OpDecorate %34 Binding 0
+ OpDecorate %108 Location 0
+ %2 = OpTypeVoid
+ %3 = OpTypeFunction %2
+ %6 = OpTypeFloat 32
+ %7 = OpTypeInt 32 0
+ %8 = OpConstant %7 2
+ %9 = OpTypeArray %6 %8
+ %10 = OpTypePointer Function %9
+ %12 = OpTypeInt 32 1
+ %13 = OpConstant %12 0
+ %14 = OpConstant %7 3
+ %15 = OpTypeArray %6 %14
+ %16 = OpTypeStruct %15
+ %17 = OpTypePointer Uniform %16
+ %18 = OpVariable %17 Uniform
+ %19 = OpConstant %12 1
+ %20 = OpTypePointer Uniform %6
+ %23 = OpTypePointer Function %6
+ %28 = OpTypePointer Function %12
+ %30 = OpConstant %7 4
+ %31 = OpTypeArray %12 %30
+ %32 = OpTypeStruct %31
+ %33 = OpTypePointer Uniform %32
+ %34 = OpVariable %33 Uniform
+ %35 = OpTypePointer Uniform %12
+ %44 = OpConstant %12 3
+ %47 = OpTypeBool
+ %58 = OpConstant %12 2
+ %66 = OpConstant %12 -2147483648
+ %106 = OpTypeVector %6 4
+ %107 = OpTypePointer Output %106
+ %108 = OpVariable %107 Output
+ %4 = OpFunction %2 None %3
+ %5 = OpLabel
+ %11 = OpVariable %10 Function
+ %29 = OpVariable %28 Function
+ %49 = OpVariable %28 Function
+ %21 = OpAccessChain %20 %18 %13 %19
+ %22 = OpLoad %6 %21
+ %24 = OpAccessChain %23 %11 %13
+ OpStore %24 %22
+ %25 = OpAccessChain %20 %18 %13 %19
+ %26 = OpLoad %6 %25
+ %27 = OpAccessChain %23 %11 %19
+ OpStore %27 %26
+ %36 = OpAccessChain %35 %34 %13 %13
+ %37 = OpLoad %12 %36
+ OpStore %29 %37
+ OpBranch %38
+ %38 = OpLabel
+ OpLoopMerge %40 %41 None
+ OpBranch %42
+ %42 = OpLabel
+ %43 = OpLoad %12 %29
+ %45 = OpAccessChain %35 %34 %13 %44
+ %46 = OpLoad %12 %45
+ %48 = OpSLessThan %47 %43 %46
+ OpBranchConditional %48 %39 %40
+ %39 = OpLabel
+ %50 = OpAccessChain %35 %34 %13 %13
+ %51 = OpLoad %12 %50
+ OpStore %49 %51
+ OpBranch %52
+ %52 = OpLabel
+ OpLoopMerge %54 %55 None
+ OpBranch %56
+ %56 = OpLabel
+ %57 = OpLoad %12 %49
+ %59 = OpAccessChain %35 %34 %13 %58
+ %60 = OpLoad %12 %59
+ %61 = OpSLessThan %47 %57 %60
+ OpBranchConditional %61 %53 %54
+ %53 = OpLabel
+ %62 = OpLoad %12 %49
+ OpSelectionMerge %65 None
+ OpSwitch %62 %65 0 %63 1 %64
+ %63 = OpLabel
+ %67 = OpLoad %12 %29
+ %68 = OpSLessThan %47 %66 %67
+ OpSelectionMerge %70 None
+ OpBranchConditional %68 %69 %70
+ %69 = OpLabel
+ OpBranch %55
+ %70 = OpLabel
+ %72 = OpLoad %12 %29
+ %73 = OpAccessChain %20 %18 %13 %58
+ %74 = OpLoad %6 %73
+ %75 = OpAccessChain %23 %11 %72
+ OpStore %75 %74
+ OpBranch %65
+ %64 = OpLabel
+ %77 = OpLoad %12 %29
+ %78 = OpAccessChain %20 %18 %13 %13
+ %79 = OpLoad %6 %78
+ %80 = OpAccessChain %23 %11 %77
+ OpStore %80 %79
+ OpBranch %65
+ %65 = OpLabel
+ OpBranch %55
+ %55 = OpLabel
+ %83 = OpLoad %12 %49
+ %84 = OpIAdd %12 %83 %19
+ OpStore %49 %84
+ OpBranch %52
+ %54 = OpLabel
+ OpBranch %41
+ %41 = OpLabel
+ %85 = OpLoad %12 %29
+ %86 = OpIAdd %12 %85 %19
+ OpStore %29 %86
+ OpBranch %38
+ %40 = OpLabel
+ %87 = OpAccessChain %35 %34 %13 %13
+ %88 = OpLoad %12 %87
+ %89 = OpAccessChain %23 %11 %88
+ %90 = OpLoad %6 %89
+ %91 = OpAccessChain %20 %18 %13 %13
+ %92 = OpLoad %6 %91
+ %93 = OpFOrdEqual %47 %90 %92
+ OpSelectionMerge %95 None
+ OpBranchConditional %93 %94 %95
+ %94 = OpLabel
+ %96 = OpAccessChain %35 %34 %13 %19
+ %97 = OpLoad %12 %96
+ %98 = OpAccessChain %23 %11 %97
+ %99 = OpLoad %6 %98
+ %100 = OpAccessChain %20 %18 %13 %13
+ %101 = OpLoad %6 %100
+ %102 = OpFOrdEqual %47 %99 %101
+ OpBranch %95
+ %95 = OpLabel
+ %103 = OpPhi %47 %93 %40 %102 %94
+ OpSelectionMerge %105 None
+ OpBranchConditional %103 %104 %122
+ %104 = OpLabel
+ %109 = OpAccessChain %35 %34 %13 %19
+ %110 = OpLoad %12 %109
+ %111 = OpConvertSToF %6 %110
+ %112 = OpAccessChain %35 %34 %13 %13
+ %113 = OpLoad %12 %112
+ %114 = OpConvertSToF %6 %113
+ %115 = OpAccessChain %35 %34 %13 %13
+ %116 = OpLoad %12 %115
+ %117 = OpConvertSToF %6 %116
+ %118 = OpAccessChain %35 %34 %13 %19
+ %119 = OpLoad %12 %118
+ %120 = OpConvertSToF %6 %119
+ %121 = OpCompositeConstruct %106 %111 %114 %117 %120
+ OpStore %108 %121
+ OpBranch %105
+ %122 = OpLabel
+ %123 = OpAccessChain %35 %34 %13 %19
+ %124 = OpLoad %12 %123
+ %125 = OpConvertSToF %6 %124
+ %126 = OpCompositeConstruct %106 %125 %125 %125 %125
+ OpStore %108 %126
+ OpBranch %105
+ %105 = OpLabel
+ OpReturn
+ OpFunctionEnd
+END
+
+# uniforms for variant
+
+# _GLF_uniform_float_values
+BUFFER variant__GLF_uniform_float_values DATA_TYPE float[] STD140 DATA
+ 1.0 0.0 2.0
+END
+# _GLF_uniform_int_values
+BUFFER variant__GLF_uniform_int_values DATA_TYPE int32[] STD140 DATA
+ 0 1 4 2
+END
+
+BUFFER variant_framebuffer FORMAT B8G8R8A8_UNORM
+
+PIPELINE graphics variant_pipeline
+ ATTACH variant_vertex_shader
+ ATTACH variant_fragment_shader
+ FRAMEBUFFER_SIZE 16 16
+ BIND BUFFER variant_framebuffer AS color LOCATION 0
+ 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 16 16
+
+EXPECT variant_framebuffer IDX 0 0 SIZE 16 16 EQ_RGBA 255 0 0 255
{ "cov-apfloat-negative-step-func.amber", "cov-apfloat-negative-step-func", "A fragment shader that covers a specific floating point code path" },
{ "cov-apfloat-tanh.amber", "cov-apfloat-tanh", "A fragment shader that covers a specific arbitrary precision float usage." },
{ "cov-apfloat-undefined-matrix-mul.amber", "cov-apfloat-undefined-matrix-mul", "A fragment shader that covers a specific floating point code path" },
+{ "cov-apfloat-determinant-for-if.amber", "cov-apfloat-determinant-for-if", "A fragment shader that covers a specific APFloat code path" },
+{ "cov-apfloat-reflect-denorm.amber", "cov-apfloat-reflect-denorm", "A fragment shader that covers a specific floating point code path" },
+{ "cov-apfloat-unpackunorm-loop.amber", "cov-apfloat-unpackunorm-loop", "A fragment shader that covers a specific floating point code path" },
{ "cov-basic-block-discard-in-function.amber", "cov-basic-block-discard-in-function", "A fragment shader that covers a specific basic block code path" },
{ "cov-blockfrequency-several-for-loops.amber", "cov-blockfrequency-several-for-loops", "A fragment shader that covers a specific block frequency info code path." },
{ "cov-branch-probability-identity-matrix.amber", "cov-branch-probability-identity-matrix", "A fragment shader that covers a specific branch propability path" },
{ "cov-combine-and-or-xor-gt-lt.amber", "cov-combine-and-or-xor-gt-lt", "A fragment shader that covers a specific bitwise operator cobmining code path" },
{ "cov-const-folding-bitfieldinsert-div-one.amber", "cov-const-folding-bitfieldinsert-div-one", "A fragment shader that covers a specific const folding path" },
+{ "cov-color-overwrite-identity-matrix-multiply.amber", "cov-color-overwrite-identity-matrix-multiply", "A fragment shader that covers a specific DAG code paths" },
{ "cov-const-folding-ceil-vec4.amber", "cov-const-folding-ceil-vec4", "A fragment shader that covers a specific constant folding code path" },
{ "cov-const-folding-clamp.amber", "cov-const-folding-clamp", "A fragment shader that covers a specific const folding rule path." },
{ "cov-const-folding-clamp-inside-while.amber", "cov-const-folding-clamp-inside-while", "A fragment shader that covers a specific constant folding path" },
{ "cov-dag-combiner-same-cond-nested.amber", "cov-dag-combiner-same-cond-nested", "A fragment shader that covers a specific DAG combiner code path" },
{ "cov-dead-branch-func-return-arg.amber", "cov-dead-branch-func-return-arg", "A fragment shader that covers a specific dead branch elimination path" },
{ "cov-dead-code-unreachable-merge.amber", "cov-dead-code-unreachable-merge", "A fragment shader that covers a specific dead code elimination path." },
+{ "cov-findlsb-division-by-zero.amber", "cov-findlsb-division-by-zero", "A fragment shader that covers a specific instruction simplify code path" },
{ "cov-fold-and-in-for-loop-range.amber", "cov-fold-and-in-for-loop-range", "A fragment shader that covers a specific folding path" },
{ "cov-fold-bitwise-and-zero.amber", "cov-fold-bitwise-and-zero", "A fragment shader that covers a specific instruction folding path." },
{ "cov-fold-bitwise-or-full-mask.amber", "cov-fold-bitwise-or-full-mask", "A fragment shader that covers a specific instruction folding path." },
{ "cov-folding-rules-split-vector-init.amber", "cov-folding-rules-split-vector-init", "A fragment shader that covers a specific instruction folding path." },
{ "cov-folding-rules-vec-mix-uniform.amber", "cov-folding-rules-vec-mix-uniform", "A fragment shader that covers a specific instruction folding path." },
{ "cov-if-conversion-identical-branches.amber", "cov-if-conversion-identical-branches", "A fragment shader that covers a specific if condition conversion path." },
+{ "cov-inc-array-element-loop-lsb.amber", "cov-inc-array-element-loop-lsb", "A fragment shader that covers a specific SSCP path" },
{ "cov-inc-inside-switch-and-for.amber", "cov-inc-inside-switch-and-for", "A fragment shader that covers a specific LLVM analysis code path." },
{ "cov-increment-inside-clamp.amber", "cov-increment-inside-clamp", "A fragment shader that covers specific value tracking and simplification paths" },
{ "cov-inline-pass-empty-block.amber", "cov-inline-pass-empty-block", "A fragment shader that covers a specific inlining optimization path." },
{ "cov-inst-combine-shifts-mix-mix-clamp.amber", "cov-inst-combine-shifts-mix-mix-clamp", "A fragment shader that covers a specific instruction combine shifts code path" },
{ "cov-instr-info-det-mat-min.amber", "cov-instr-info-det-mat-min", "A fragment shader that covers a specific instr info code path" },
{ "cov-instructions-for-if-less-than-equal.amber", "cov-instructions-for-if-less-than-equal", "Covers specific instruction simplify and combine compare code paths" },
+{ "cov-inst-combine-and-or-xor-for-bitfieldinsert.amber", "cov-inst-combine-and-or-xor-for-bitfieldinsert", "A fragment shader that covers a specific inst combine and or xor code path" },
+{ "cov-inst-combine-compares-pre-increment-clamp.amber", "cov-inst-combine-compares-pre-increment-clamp", "A fragment shader that covers a specific inst combine compares code path" },
+{ "cov-inst-combine-mul-div-rem-if-undefined-divide-mix.amber", "cov-inst-combine-mul-div-rem-if-undefined-divide-mix", "A fragment shader that covers a specific inst combine mul div rem code path" },
+{ "cov-inst-combine-pack-unpack.amber", "cov-inst-combine-pack-unpack", "Covers specific combine shifts and combine simplify demanded code paths" },
+{ "cov-inst-combine-select-findlsb-uaddcarry.amber", "cov-inst-combine-select-findlsb-uaddcarry", "A fragment shader that covers a specific instruction combine select code path" },
+{ "cov-inst-combine-simplify-demanded-pack-unpack.amber", "cov-inst-combine-simplify-demanded-pack-unpack", "Covers a specific instruction combine simplify demanded code path" },
+{ "cov-inst-combine-simplify-demanded-packsnorm-unpackunorm.amber", "cov-inst-combine-simplify-demanded-packsnorm-unpackunorm", "Covers a specific instruction combine simplify demanded code path" },
+{ "cov-inst-combine-simplify-demanded-switch-or-xor.amber", "cov-inst-combine-simplify-demanded-switch-or-xor", "A fragment shader that covers a specific inst combine simplify demanded path" },
+{ "cov-inst-combine-vector-ops-asin.amber", "cov-inst-combine-vector-ops-asin", "A fragment shader that covers specific inst combine vector ops code paths" },
+{ "cov-integer-modulo-negative.amber", "cov-integer-modulo-negative", "A fragment shader that covers specific instruction combining code paths" },
{ "cov-intervalmap-set-stop.amber", "cov-intervalmap-set-stop", "A fragment shader that covers a specific interval map code path." },
{ "cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if.amber", "cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if", "Covers IR builder, constant fold, inst combine calls and value tracking code paths"},
{ "cov-irbuilder-matrix-cell-uniform.amber", "cov-irbuilder-matrix-cell-uniform", "A fragment shader that covers a specific IR builder path." },
{ "cov-liveinterval-different-dest.amber", "cov-liveinterval-different-dest", "A fragment shader that covers a specific live interval code path." },
{ "cov-loop-findmsb-findlsb.amber", "cov-loop-findmsb-findlsb", "A fragment shader that covers specific simplification and value tracking paths" },
{ "cov-machine-scheduler-for-if-pow.amber", "cov-machine-scheduler-for-if-pow", "A fragment shader that covers a specific machine scheduler path" },
+{ "cov-machine-basic-block-for-for-for-less-than.amber", "cov-machine-basic-block-for-for-for-less-than", "A fragment shader that covers a specific machine basic block code paths" },
{ "cov-machinevaluetype-one-iter-loop.amber", "cov-machinevaluetype-one-iter-loop", "A fragment shader that covers a specific machine value type code path" },
{ "cov-max-clamp-same-minval.amber", "cov-max-clamp-same-minval", "A fragment shader that covers a specific instruction simplification path" },
{ "cov-mem-pass-sum-struct-members.amber", "cov-mem-pass-sum-struct-members", "A fragment shader that covers a specific mem pass code path." },
{ "cov-mem-pass-unused-component.amber", "cov-mem-pass-unused-component", "A fragment shader that covers a specific mem pass code path." },
{ "cov-merge-return-condition-twice.amber", "cov-merge-return-condition-twice", "A fragment shader that covers a specific return merge path." },
+{ "cov-mod-acosh.amber", "cov-mod-acosh", "A fragment shader that calculates modulo of an acosh result" },
+{ "cov-modf-clamp-for.amber", "cov-modf-clamp-for", "A fragment shader that covers a specific live intervals code path" },
{ "cov-modf-integer-to-private.amber", "cov-modf-integer-to-private", "A fragment shader that covers a specific private to local path." },
{ "cov-optimize-phis-for.amber", "cov-optimize-phis-for", "A fragment shader that cover specific optimize phis code paths" },
{ "cov-optimize-phis-for-for-do-while-if-if.amber", "cov-optimize-phis-for-for-do-while-if-if", "A fragment shader that covers a specific optimize PHIs code path" },
+{ "cov-not-clamp-matrix-access.amber", "cov-not-clamp-matrix-access", "A fragment shader that covers a specific selection dag code path" },
{ "cov-pattern-match-signum.amber", "cov-pattern-match-signum", "A fragment shader that covers a specific pattern matching path." },
{ "cov-pattern-match-single-bit.amber", "cov-pattern-match-single-bit", "A fragment shader that covers a specific pattern matching path." },
{ "cov-peephole-optimizer-target-instr-info-for-if-if-if.amber", "cov-peephole-optimizer-target-instr-info-for-if-if-if", "Covers peephole optimizer and instr info code paths" },
{ "cov-reduce-load-replace-extract.amber", "cov-reduce-load-replace-extract", "A fragment shader that covers a specific load size reduction path." },
{ "cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard.amber", "cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard", "Covers register coalescer, live intervals and target instr info code paths" },
{ "cov-replace-copy-object.amber", "cov-replace-copy-object", "A fragment shader that covers a specific shader simplification path." },
+{ "cov-return-after-do-while.amber", "cov-return-after-do-while", "A fragment shader that covers a specific simplify cfg code path" },
{ "cov-scaled-number-nested-loops.amber", "cov-scaled-number-nested-loops", "A fragment shader that covers a specific scaled number code path." },
{ "cov-selection-dag-assign-back-and-forth.amber", "cov-selection-dag-assign-back-and-forth", "A fragment shader that covers a specific selection DAG code path" },
{ "cov-selection-dag-lt-gt.amber", "cov-selection-dag-lt-gt", "A fragment shader that covers a specific selection DAG code path" },
{ "cov-scaled-number-nested-loops-array-access.amber", "cov-scaled-number-nested-loops-array-access", "A fragment shader that covers a specific scaled number path" },
+{ "cov-schedule-dag-rrlist-mix-log-cos.amber", "cov-schedule-dag-rrlist-mix-log-cos", "Covers a specific schedule dag register reduction list code path" },
+{ "cov-selection-dag-inverse-clamp.amber", "cov-selection-dag-inverse-clamp", "A fragment shader that covers a specific selection DAG code path" },
{ "cov-selection-dag-same-cond-twice.amber", "cov-selection-dag-same-cond-twice", "A fragment shader that covers a specific selection DAG code path" },
{ "cov-set-vector-cos-fragcoord.amber", "cov-set-vector-cos-fragcoord", "A fragment shader that covers a specific set vector code path." },
{ "cov-simplification-unused-struct.amber", "cov-simplification-unused-struct", "A fragment shader that covers a specific shader simplification path." },
{ "cov-simplification-while-inside-for.amber", "cov-simplification-while-inside-for", "A fragment shader that covers a specific code simplification path." },
{ "cov-simplify-clamp-max-itself.amber", "cov-simplify-clamp-max-itself", "A fragment shader that covers a specific instruction simplification code path" },
+{ "cov-simplify-combine-compares-max-max-one.amber", "cov-simplify-combine-compares-max-max-one", "Covers specific instruction simplifying and combining code paths" },
{ "cov-simplify-component-uniform-idx.amber", "cov-simplify-component-uniform-idx", "A fragment shader that covers a specific instruction simplification code path" },
{ "cov-simplify-div-by-uint-one.amber", "cov-simplify-div-by-uint-one", "A fragment shader that covers a specific instruction simplification code path" },
{ "cov-simplify-for-bitwise-condition.amber", "cov-simplify-for-bitwise-condition", "A fragment shader that covers a specific instruction simplify code path" },
{ "cov-simplify-ldexp-exponent-zero.amber", "cov-simplify-ldexp-exponent-zero", "A fragment shader that covers a specific instruction simplification code path" },
+{ "cov-simplify-max-multiplied-values.amber", "cov-simplify-max-multiplied-values", "A fragment shader that covers a specific instruction simplify code path" },
+{ "cov-simplify-modulo-1.amber", "cov-simplify-modulo-1", "A fragment shader that covers a specific instruction simplification code path" },
{ "cov-simplify-mul-identity.amber", "cov-simplify-mul-identity", "A fragment shader that covers a specific instruction simplification code path" },
{ "cov-simplify-not-less-than-neg.amber", "cov-simplify-not-less-than-neg", "A fragment shader that covers a specific instruction simplification code path" },
{ "cov-simplify-right-shift-greater-than-zero.amber", "cov-simplify-right-shift-greater-than-zero", "Covers specific instruction simplify and combine compare code paths" },
{ "cov-wrap-op-kill-two-branches.amber", "cov-wrap-op-kill-two-branches", "A fragment shader that covers a specific OpKill wrapping path." },
{ "cov-x86-isel-lowering-machine-value-type-uint-to-float.amber", "cov-x86-isel-lowering-machine-value-type-uint-to-float", "Covers specific X86 ISel lowering and machine value type code paths" },
{ "cov-x86-isel-lowering-selection-dag-struct-array-clamp-index.amber", "cov-x86-isel-lowering-selection-dag-struct-array-clamp-index", "Covers a specific X86 ISel lowering and DAG selection code paths" },
+{ "cov-x86-isel-lowering-apfloat-nan-cos-cos.amber", "cov-x86-isel-lowering-apfloat-nan-cos-cos", "A fragment shader that covers a specific X86 ISel lowering and AP Float code paths"},
+{ "cov-x86-isel-lowering-negative-left-shift.amber", "cov-x86-isel-lowering-negative-left-shift", "A fragment shader that covers a specific X86 ISel lowering code path" },
{ "create-color-in-do-while-for-loop.amber", "create-color-in-do-while-for-loop", "A fragment shader that creates the color inside two loops" },
{ "dead-barriers-in-loops.amber", "dead-barriers-in-loops", "A compute shader with dead barriers" },
{ "dead-struct-init.amber", "dead-struct-init", "A fragment shader that uses struct initializers" },
dEQP-VK.graphicsfuzz.cov-apfloat-negative-step-func
dEQP-VK.graphicsfuzz.cov-apfloat-tanh
dEQP-VK.graphicsfuzz.cov-apfloat-undefined-matrix-mul
+dEQP-VK.graphicsfuzz.cov-apfloat-determinant-for-if
+dEQP-VK.graphicsfuzz.cov-apfloat-reflect-denorm
+dEQP-VK.graphicsfuzz.cov-apfloat-unpackunorm-loop
dEQP-VK.graphicsfuzz.cov-basic-block-discard-in-function
dEQP-VK.graphicsfuzz.cov-blockfrequency-several-for-loops
dEQP-VK.graphicsfuzz.cov-branch-probability-identity-matrix
dEQP-VK.graphicsfuzz.cov-combine-and-or-xor-gt-lt
dEQP-VK.graphicsfuzz.cov-const-folding-bitfieldinsert-div-one
+dEQP-VK.graphicsfuzz.cov-color-overwrite-identity-matrix-multiply
dEQP-VK.graphicsfuzz.cov-const-folding-ceil-vec4
dEQP-VK.graphicsfuzz.cov-const-folding-clamp
dEQP-VK.graphicsfuzz.cov-const-folding-clamp-inside-while
dEQP-VK.graphicsfuzz.cov-dag-combiner-same-cond-nested
dEQP-VK.graphicsfuzz.cov-dead-branch-func-return-arg
dEQP-VK.graphicsfuzz.cov-dead-code-unreachable-merge
+dEQP-VK.graphicsfuzz.cov-findlsb-division-by-zero
dEQP-VK.graphicsfuzz.cov-fold-and-in-for-loop-range
dEQP-VK.graphicsfuzz.cov-fold-bitwise-and-zero
dEQP-VK.graphicsfuzz.cov-fold-bitwise-or-full-mask
dEQP-VK.graphicsfuzz.cov-folding-rules-split-vector-init
dEQP-VK.graphicsfuzz.cov-folding-rules-vec-mix-uniform
dEQP-VK.graphicsfuzz.cov-if-conversion-identical-branches
+dEQP-VK.graphicsfuzz.cov-inc-array-element-loop-lsb
dEQP-VK.graphicsfuzz.cov-inc-inside-switch-and-for
dEQP-VK.graphicsfuzz.cov-increment-inside-clamp
dEQP-VK.graphicsfuzz.cov-inline-pass-empty-block
dEQP-VK.graphicsfuzz.cov-inst-combine-shifts-mix-mix-clamp
dEQP-VK.graphicsfuzz.cov-instr-info-det-mat-min
dEQP-VK.graphicsfuzz.cov-instructions-for-if-less-than-equal
+dEQP-VK.graphicsfuzz.cov-inst-combine-and-or-xor-for-bitfieldinsert
+dEQP-VK.graphicsfuzz.cov-inst-combine-compares-pre-increment-clamp
+dEQP-VK.graphicsfuzz.cov-inst-combine-mul-div-rem-if-undefined-divide-mix
+dEQP-VK.graphicsfuzz.cov-inst-combine-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-select-findlsb-uaddcarry
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-pack-unpack
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-packsnorm-unpackunorm
+dEQP-VK.graphicsfuzz.cov-inst-combine-simplify-demanded-switch-or-xor
+dEQP-VK.graphicsfuzz.cov-inst-combine-vector-ops-asin
+dEQP-VK.graphicsfuzz.cov-integer-modulo-negative
dEQP-VK.graphicsfuzz.cov-intervalmap-set-stop
dEQP-VK.graphicsfuzz.cov-ir-builder-constant-fold-inst-combine-calls-value-tracking-findmsb-incr-if
dEQP-VK.graphicsfuzz.cov-irbuilder-matrix-cell-uniform
dEQP-VK.graphicsfuzz.cov-liveinterval-different-dest
dEQP-VK.graphicsfuzz.cov-loop-findmsb-findlsb
dEQP-VK.graphicsfuzz.cov-machine-scheduler-for-if-pow
+dEQP-VK.graphicsfuzz.cov-machine-basic-block-for-for-for-less-than
dEQP-VK.graphicsfuzz.cov-machinevaluetype-one-iter-loop
dEQP-VK.graphicsfuzz.cov-max-clamp-same-minval
dEQP-VK.graphicsfuzz.cov-mem-pass-sum-struct-members
dEQP-VK.graphicsfuzz.cov-mem-pass-unused-component
dEQP-VK.graphicsfuzz.cov-merge-return-condition-twice
+dEQP-VK.graphicsfuzz.cov-mod-acosh
+dEQP-VK.graphicsfuzz.cov-modf-clamp-for
dEQP-VK.graphicsfuzz.cov-modf-integer-to-private
dEQP-VK.graphicsfuzz.cov-optimize-phis-for
dEQP-VK.graphicsfuzz.cov-optimize-phis-for-for-do-while-if-if
+dEQP-VK.graphicsfuzz.cov-not-clamp-matrix-access
dEQP-VK.graphicsfuzz.cov-pattern-match-signum
dEQP-VK.graphicsfuzz.cov-pattern-match-single-bit
dEQP-VK.graphicsfuzz.cov-peephole-optimizer-target-instr-info-for-if-if-if
dEQP-VK.graphicsfuzz.cov-reduce-load-replace-extract
dEQP-VK.graphicsfuzz.cov-register-coalescer-live-intervals-target-instr-info-for-discard-for-discard
dEQP-VK.graphicsfuzz.cov-replace-copy-object
+dEQP-VK.graphicsfuzz.cov-return-after-do-while
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops
dEQP-VK.graphicsfuzz.cov-selection-dag-assign-back-and-forth
dEQP-VK.graphicsfuzz.cov-selection-dag-lt-gt
dEQP-VK.graphicsfuzz.cov-scaled-number-nested-loops-array-access
+dEQP-VK.graphicsfuzz.cov-schedule-dag-rrlist-mix-log-cos
+dEQP-VK.graphicsfuzz.cov-selection-dag-inverse-clamp
dEQP-VK.graphicsfuzz.cov-selection-dag-same-cond-twice
dEQP-VK.graphicsfuzz.cov-set-vector-cos-fragcoord
dEQP-VK.graphicsfuzz.cov-simplification-unused-struct
dEQP-VK.graphicsfuzz.cov-simplification-while-inside-for
dEQP-VK.graphicsfuzz.cov-simplify-clamp-max-itself
+dEQP-VK.graphicsfuzz.cov-simplify-combine-compares-max-max-one
dEQP-VK.graphicsfuzz.cov-simplify-component-uniform-idx
dEQP-VK.graphicsfuzz.cov-simplify-div-by-uint-one
dEQP-VK.graphicsfuzz.cov-simplify-for-bitwise-condition
dEQP-VK.graphicsfuzz.cov-simplify-ldexp-exponent-zero
+dEQP-VK.graphicsfuzz.cov-simplify-max-multiplied-values
+dEQP-VK.graphicsfuzz.cov-simplify-modulo-1
dEQP-VK.graphicsfuzz.cov-simplify-mul-identity
dEQP-VK.graphicsfuzz.cov-simplify-not-less-than-neg
dEQP-VK.graphicsfuzz.cov-simplify-right-shift-greater-than-zero
dEQP-VK.graphicsfuzz.cov-wrap-op-kill-two-branches
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-machine-value-type-uint-to-float
dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-selection-dag-struct-array-clamp-index
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-apfloat-nan-cos-cos
+dEQP-VK.graphicsfuzz.cov-x86-isel-lowering-negative-left-shift
dEQP-VK.graphicsfuzz.create-color-in-do-while-for-loop
dEQP-VK.graphicsfuzz.dead-barriers-in-loops
dEQP-VK.graphicsfuzz.dead-struct-init