From: Dave Airlie <[email protected]>

This is ported from the GLSL 3.00 ES tests, since GLSL 1.50
has the same change.

Signed-off-by: Dave Airlie <[email protected]>
---
 .../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

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

Reply via email to