summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-29 15:34:21 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-29 15:34:21 -0700
commit32a494586fa8cb01a4ff4c5fa270d29e15c09aa8 (patch)
treec2ba6461b7187009fb4f3f7deff4d9d01342c2ac /tests
parent96f9cea11606bb1bd8e07edc17032447424b8bff (diff)
Add tests for :? operator
Diffstat (limited to 'tests')
-rw-r--r--tests/condition-01.glsl8
-rw-r--r--tests/condition-02.glsl8
-rw-r--r--tests/condition-03.glsl8
-rw-r--r--tests/condition-04.glsl8
-rw-r--r--tests/condition-05.glsl13
5 files changed, 45 insertions, 0 deletions
diff --git a/tests/condition-01.glsl b/tests/condition-01.glsl
new file mode 100644
index 0000000000..d89c313117
--- /dev/null
+++ b/tests/condition-01.glsl
@@ -0,0 +1,8 @@
+/* FAIL - :? condition is not bool scalar */
+
+uniform bvec4 a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/condition-02.glsl b/tests/condition-02.glsl
new file mode 100644
index 0000000000..cbd0e18d9a
--- /dev/null
+++ b/tests/condition-02.glsl
@@ -0,0 +1,8 @@
+/* FAIL - :? condition is not bool scalar */
+
+uniform float a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/condition-03.glsl b/tests/condition-03.glsl
new file mode 100644
index 0000000000..9af5d7aa47
--- /dev/null
+++ b/tests/condition-03.glsl
@@ -0,0 +1,8 @@
+/* PASS */
+
+uniform bool a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/tests/condition-04.glsl b/tests/condition-04.glsl
new file mode 100644
index 0000000000..f440b7e995
--- /dev/null
+++ b/tests/condition-04.glsl
@@ -0,0 +1,8 @@
+/* FAIL - type of second two operands must match */
+
+uniform bool a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);
+}
diff --git a/tests/condition-05.glsl b/tests/condition-05.glsl
new file mode 100644
index 0000000000..3dff18f519
--- /dev/null
+++ b/tests/condition-05.glsl
@@ -0,0 +1,13 @@
+#version 120
+/* PASS */
+
+uniform bool a;
+uniform int b;
+
+void main()
+{
+ float x;
+
+ x = (a) ? 2.0 : b;
+ gl_Position = vec4(x);
+}