[Piglit] [PATCH] Add glsl-1.30/execution/fs-loop-cont-else-bug

Nicolai Hähnle nhaehnle at gmail.com
Wed Sep 28 20:01:15 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This is a regression test for a very specific compiler bug in radeonsi.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97887
---
 .../execution/fs-loop-cont-else-bug.shader_test    | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/execution/fs-loop-cont-else-bug.shader_test

diff --git a/tests/spec/glsl-1.30/execution/fs-loop-cont-else-bug.shader_test b/tests/spec/glsl-1.30/execution/fs-loop-cont-else-bug.shader_test
new file mode 100644
index 0000000..f66c95e
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/fs-loop-cont-else-bug.shader_test
@@ -0,0 +1,44 @@
+# This test used to create bad LLVM IR in radeonsi.
+#
+# Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97887
+
+[require]
+GLSL >= 1.30
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 130
+
+uniform int initial;
+
+void main() {
+	int idx = 0;
+	int x = initial;
+
+	for (;;) {
+		idx++;
+		if (idx >= 3)
+			break;
+
+		if (x % 2 == 0) {
+			x = x / 2;
+			if (x == 18)
+				break;
+			continue;
+		} else {
+			x = x * 3;
+		}
+		x++;
+	}
+
+	gl_FragColor = vec4(0.0, (x % 4) * 0.25, 0.0, 1.0);
+}
+
+[test]
+clear color 1.0 0.0 0.0 1.0
+clear
+
+uniform int initial 7
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.75 0.0 1.0
-- 
2.7.4



More information about the Piglit mailing list