summaryrefslogtreecommitdiff
path: root/tests/glslparsertest
diff options
context:
space:
mode:
authorChad Versace <chad.versace@intel.com>2010-10-15 14:25:04 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-10-19 11:26:55 -0700
commitfd1a77b3e15e2ed1f300ac36817742c1dfbe261b (patch)
tree8bcb623d81ffd96772027b0d0f604159879398c2 /tests/glslparsertest
parentb5f1788ef0fca5533b2b6ab98d88766ef79fb987 (diff)
glslparsertest: Add tests for bit-logic assignments in GLSL 1.30
These tests are a near copy of the tests added in commit "glslparsertest: Add tests for bit logic ops in GLSL 1.30". Each new file 'bit-logic-assign-NN.frag' is a modified copy of file 'bit-logic-NN.frag', except for 'bit-logic-assign-11.frag'.
Diffstat (limited to 'tests/glslparsertest')
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-01.frag15
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-02.frag15
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-03.frag19
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-04.frag19
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-05.frag12
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-06.frag12
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-07.frag12
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-08.frag12
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-09.frag13
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-10.frag34
-rw-r--r--tests/glslparsertest/glsl2/bit-logic-assign-11.frag9
11 files changed, 172 insertions, 0 deletions
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-01.frag b/tests/glslparsertest/glsl2/bit-logic-assign-01.frag
new file mode 100644
index 00000000..cc0fe879
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-01.frag
@@ -0,0 +1,15 @@
+// Expected: PASS, glsl == 1.30
+//
+// Description: bit-logic assignment ops with argument type (int, int)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands must be of type signed or unsigned integers or integer
+// vectors."
+
+#version 130
+void main() {
+ int x = 0;
+ x &= 1;
+ x |= 1;
+ x ^= 1;
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-02.frag b/tests/glslparsertest/glsl2/bit-logic-assign-02.frag
new file mode 100644
index 00000000..caa20872
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-02.frag
@@ -0,0 +1,15 @@
+// Expected: PASS, glsl == 1.30
+//
+// Description: bit-logic assignment ops with argument type (uint, uint)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands must be of type signed or unsigned integers or integer
+// vectors."
+
+#version 130
+void main() {
+ uint x = uint(0);
+ x &= uint(1);
+ x |= uint(1);
+ x ^= uint(1);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-03.frag b/tests/glslparsertest/glsl2/bit-logic-assign-03.frag
new file mode 100644
index 00000000..fcd2c8b4
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-03.frag
@@ -0,0 +1,19 @@
+// Expected: PASS, glsl == 1.30
+//
+// Description: bit-logic assignment ops with argument type (ivecN, ivecN)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands must be of type signed or unsigned integers or integer
+// vectors."
+
+#version 130
+void main() {
+ ivec2 v2 = ivec2(0, 1);
+ v2 &= v2;
+
+ ivec3 v3 = ivec3(0, 1, 2);
+ v3 |= v3;
+
+ ivec4 v4 = ivec4(0, 1, 2, 3);
+ v4 ^= v4;
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-04.frag b/tests/glslparsertest/glsl2/bit-logic-assign-04.frag
new file mode 100644
index 00000000..35a9a0cb
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-04.frag
@@ -0,0 +1,19 @@
+// Expected: PASS, glsl == 1.30
+//
+// Description: bit-logic assignment ops with argument type (uvecN, uvecN)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands must be of type signed or unsigned integers or integer
+// vectors."
+
+#version 130
+void main() {
+ uvec2 v2 = uvec2(0, 1);
+ v2 &= v2;
+
+ uvec3 v3 = uvec3(0, 1, 2);
+ v3 |= v3;
+
+ uvec4 v4 = uvec4(0, 1, 2, 3);
+ v4 ^= v4;
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-05.frag b/tests/glslparsertest/glsl2/bit-logic-assign-05.frag
new file mode 100644
index 00000000..c0db3b70
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-05.frag
@@ -0,0 +1,12 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-and assignment with argument type (int, uint)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The fundamental types of the operands (signed or unsigned) must match"
+
+#version 130
+void main() {
+ int x = 7;
+ x &= uint(1);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-06.frag b/tests/glslparsertest/glsl2/bit-logic-assign-06.frag
new file mode 100644
index 00000000..25b0e8dc
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-06.frag
@@ -0,0 +1,12 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-and assignment with argument type (ivec2, uvec2)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The fundamental types of the operands (signed or unsigned) must match"
+
+#version 130
+void main() {
+ ivec2 v = ivec2(1, 2);
+ v &= uvec2(1, 2);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-07.frag b/tests/glslparsertest/glsl2/bit-logic-assign-07.frag
new file mode 100644
index 00000000..c0a1d8dc
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-07.frag
@@ -0,0 +1,12 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-and assignment with argument type (ivec2, ivec3)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands cannot be vectors of differing size."
+
+#version 130
+void main() {
+ ivec2 v = ivec2(1, 2);
+ v &= ivec3(1, 2, 3);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-08.frag b/tests/glslparsertest/glsl2/bit-logic-assign-08.frag
new file mode 100644
index 00000000..690fbb67
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-08.frag
@@ -0,0 +1,12 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-and assignment with argument type (ivec2, uint)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The fundamental types of the operands (signed or unsigned) must match"
+
+#version 130
+void main() {
+ ivec2 v = ivec2(0, 1);
+ v &= uint(7);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-09.frag b/tests/glslparsertest/glsl2/bit-logic-assign-09.frag
new file mode 100644
index 00000000..46950cea
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-09.frag
@@ -0,0 +1,13 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-and assignment with argument type (bool, bool)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "The operands must be of type signed or unsigned integers or integer
+// vectors."
+
+#version 130
+void main() {
+ bool b = true;
+ b &= false;
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-10.frag b/tests/glslparsertest/glsl2/bit-logic-assign-10.frag
new file mode 100644
index 00000000..bbc980ca
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-10.frag
@@ -0,0 +1,34 @@
+// Expected: PASS, glsl == 1.30
+//
+// Description: bit-logic assignment ops with argument types:
+// - (ivecN, int)
+// - (uvecN, uint)
+//
+// From page 50 (page 56 of PDF) of the GLSL 1.30 spec:
+// "If one operand is a scalar and the other a vector, the scalar is applied
+// component-wise to the vector, resulting in the same type as the vector."
+
+#version 130
+void main() {
+ // (ivecN, int) --------------------------
+
+ ivec2 v00 = ivec2(0, 1);
+ v00 &= int(7);
+
+ ivec3 v01 = ivec3(0, 1, 2);
+ v01 |= int(7);
+
+ ivec4 v02 = ivec4(0, 1, 2, 3);
+ v02 ^= int(7);
+
+ // (uvecN, uint) --------------------------
+
+ uvec2 v10 = uvec2(0, 1);
+ v10 &= uint(7);
+
+ uvec3 v11 = uvec3(0, 1, 2);
+ v11 |= uint(7);
+
+ uvec4 v12 = uvec4(0, 1, 2, 3);
+ v12 ^= uint(7);
+}
diff --git a/tests/glslparsertest/glsl2/bit-logic-assign-11.frag b/tests/glslparsertest/glsl2/bit-logic-assign-11.frag
new file mode 100644
index 00000000..7ddcb29d
--- /dev/null
+++ b/tests/glslparsertest/glsl2/bit-logic-assign-11.frag
@@ -0,0 +1,9 @@
+// Expected: FAIL, glsl == 1.30
+//
+// Description: bit-or assignment with argument type (int, ivec2)
+
+#version 130
+void main() {
+ int x = 0;
+ x |= ivec2(0, 1);
+}