aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/spec/glsl-1.50/compiler/no-statement-before-first-case.vert24
1 files changed, 24 insertions, 0 deletions
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 00000000..3cff8e7e
--- /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;
+ }
+}