[Piglit] [PATCH 1/4] glsl-1.50: add no statement before first case compiler test
Dave Airlie
airlied at gmail.com
Sun Jan 13 19:15:22 PST 2013
From: Dave Airlie <airlied at redhat.com>
This is ported from the GLSL 3.00 ES tests, since GLSL 1.50
has the same change.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
.../compiler/no-statement-before-first-case.vert | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 tests/spec/glsl-1.50/compiler/no-statement-before-first-case.vert
diff --git a/tests/spec/glsl-1.50/compiler/no-statement-before-first-case.vert b/tests/spec/glsl-1.50/compiler/no-statement-before-first-case.vert
new file mode 100644
index 0000000..3cff8e7
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/no-statement-before-first-case.vert
@@ -0,0 +1,24 @@
+#version 150
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Page 66 of the OpenGL Shading Language 1.50 spec says:
+ *
+ * "No statements are allowed in a switch statement before the first case
+ * statement."
+ */
+
+uniform int x;
+
+void main()
+{
+ switch (x) {
+ gl_Position = vec4(0.);
+ default:
+ gl_Position = vec4(1.);
+ break;
+ }
+}
--
1.8.1
More information about the Piglit
mailing list