Add several simple if-statement tests
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 21:11:10 +0000 (14:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 29 Mar 2010 21:11:10 +0000 (14:11 -0700)
tests/if-01.glsl [new file with mode: 0644]
tests/if-02.glsl [new file with mode: 0644]
tests/if-03.glsl [new file with mode: 0644]
tests/if-04.glsl [new file with mode: 0644]

diff --git a/tests/if-01.glsl b/tests/if-01.glsl
new file mode 100644 (file)
index 0000000..ca9abd5
--- /dev/null
@@ -0,0 +1,11 @@
+/* FAIL - if-statement condition is not bool scalar */
+
+uniform bvec4 a;
+
+void main()
+{
+  if (a)
+    gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+  else
+    gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/if-02.glsl b/tests/if-02.glsl
new file mode 100644 (file)
index 0000000..7adccea
--- /dev/null
@@ -0,0 +1,11 @@
+/* FAIL - if-statement condition is not bool scalar */
+
+uniform float a;
+
+void main()
+{
+  if (a)
+    gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+  else
+    gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/if-03.glsl b/tests/if-03.glsl
new file mode 100644 (file)
index 0000000..179618c
--- /dev/null
@@ -0,0 +1,11 @@
+/* PASS */
+
+uniform bool a;
+
+void main()
+{
+  if (a)
+    gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+  else
+    gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/if-04.glsl b/tests/if-04.glsl
new file mode 100644 (file)
index 0000000..7b711fb
--- /dev/null
@@ -0,0 +1,11 @@
+/* PASS */
+
+uniform bvec4 a;
+
+void main()
+{
+  if (a.x)
+    gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+  else
+    gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}