--- .../execution/and-operator-short-circuit.shader_test | 18 ++++++++++++++++++ .../execution/or-operator-short-circuit.shader_test | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tests/spec/glsl-1.10/execution/and-operator-short-circuit.shader_test create mode 100644 tests/spec/glsl-1.10/execution/or-operator-short-circuit.shader_test
diff --git a/tests/spec/glsl-1.10/execution/and-operator-short-circuit.shader_test b/tests/spec/glsl-1.10/execution/and-operator-short-circuit.shader_test new file mode 100644 index 0000000..543a406 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/and-operator-short-circuit.shader_test @@ -0,0 +1,18 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main() +{ + float x = 0.75; + // this should always be false + if (x <= 0.5 && ++x > 0.0) { + x += 0.1; + } + gl_FragColor = vec4(x); +} + + +[test] +draw rect -1 -1 2 2 +relative probe rgba (0.5, 0.5) (0.75, 0.75, 0.75, 0.75) diff --git a/tests/spec/glsl-1.10/execution/or-operator-short-circuit.shader_test b/tests/spec/glsl-1.10/execution/or-operator-short-circuit.shader_test new file mode 100644 index 0000000..2fe5436 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/or-operator-short-circuit.shader_test @@ -0,0 +1,18 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +void main() +{ + float x = 0.75; + // this should always be true + if (x >= 0.5 || ++x >= 0.0) { + x += 0.1; + } + gl_FragColor = vec4(x); +} + + +[test] +draw rect -1 -1 2 2 +relative probe rgba (0.5, 0.5) (0.85, 0.85, 0.85, 0.85) -- 2.7.4 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit