[Piglit] [PATCH 2/3] ssa: Add a test for the classic "lost copy problem" in out-of-SSA translation

Jason Ekstrand jason at jlekstrand.net
Sat Dec 13 13:26:02 PST 2014


---
 tests/shaders/ssa/fs-lost-copy-problem.shader_test | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 tests/shaders/ssa/fs-lost-copy-problem.shader_test

diff --git a/tests/shaders/ssa/fs-lost-copy-problem.shader_test b/tests/shaders/ssa/fs-lost-copy-problem.shader_test
new file mode 100644
index 0000000..4eeeacc
--- /dev/null
+++ b/tests/shaders/ssa/fs-lost-copy-problem.shader_test
@@ -0,0 +1,23 @@
+[require]
+GLSL >= 1.10
+
+[fragment shader]
+uniform int count;
+
+void main()
+{
+    int j = 0;
+    for (int i = 0; i <= count; ++i)
+        j = i;
+
+    if (j == 6)
+        gl_FragColor = vec4(0, 1, 0, 1);
+    else
+        gl_FragColor = vec4(1, 0, 0, 1);
+}
+
+[test]
+uniform int count 6
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.2.0



More information about the Piglit mailing list