[Piglit] [PATCH] Add new test to exercise GLSL compiler bug involving unused const arrays

Brian Paul brianp at vmware.com
Fri Jan 2 11:53:48 PST 2015


Currently, this test causes the GLSL compiler to abort in ir_validate.cpp
with the message:
"ir_dereference_variable @ 0x182ee80 specifies undeclared variable
`unused_array' @ 0x182ed80"
---
 .../compiler/unused-const-array.shader_test        | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 tests/spec/glsl-1.20/compiler/unused-const-array.shader_test

diff --git a/tests/spec/glsl-1.20/compiler/unused-const-array.shader_test b/tests/spec/glsl-1.20/compiler/unused-const-array.shader_test
new file mode 100644
index 0000000..c3459a1
--- /dev/null
+++ b/tests/spec/glsl-1.20/compiler/unused-const-array.shader_test
@@ -0,0 +1,26 @@
+# Test declaring an unused const array to exercise a Mesa GLSL compiler bug.
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+void
+main()
+{
+	gl_Position = gl_Vertex;
+}
+
+
+[fragment shader]
+
+const int unused_array[1] = int[1](1);
+
+void
+main()
+{
+	gl_FragColor = vec4(0, 1, 0, 1);
+}
+
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.9.1



More information about the Piglit mailing list