aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-01-14 02:47:35 +0000
committerDave Airlie <airlied@redhat.com>2013-01-15 07:49:57 +0000
commitf2704c7257902b0f1b9b83d9af9aad7e448dc142 (patch)
treea1b16c9bb7d636efefdfd12c3c10b35983ec2773
parent7477eb8af9bd40536db8579607818424fb54fcc2 (diff)
downloadpiglit-f2704c7257902b0f1b9b83d9af9aad7e448dc142.tar.gz
glsl-1.50: add no statement before first case compiler test
This is ported from the GLSL 3.00 ES tests, since GLSL 1.50 has the same change. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
-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;
+ }
+}