Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100303
---
 ...-nested-return-in-loop-nested_in_if.shader_test | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test

diff --git 
a/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
 
b/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
new file mode 100644
index 0000000..aae3e47
--- /dev/null
+++ 
b/tests/spec/glsl-1.10/execution/fs-nested-return-in-loop-nested_in_if.shader_test
@@ -0,0 +1,31 @@
+# Test return lowering when nested in a loop thats nested in an if.
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+uniform int a;
+
+vec4 func1()
+{
+   if(a >= 1) {
+      for(int i = 0; i < a; i++) {
+         return vec4(0.0, 1.0, 0.0, 0.0);
+      }
+   }
+   return vec4(1.0, 0.0, 0.0, 0.0);
+}
+
+void main(void)
+{
+    gl_FragColor = func1();
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+
+uniform int a 1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.9.3

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to