summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/glsl_parser_test/ReadMe.txt3
-rw-r--r--examples/glsl_parser_test/bit-logic-assign.frag21
-rw-r--r--examples/glsl_parser_test/bit-logic.vert18
3 files changed, 42 insertions, 0 deletions
diff --git a/examples/glsl_parser_test/ReadMe.txt b/examples/glsl_parser_test/ReadMe.txt
new file mode 100644
index 000000000..21b00a5e6
--- /dev/null
+++ b/examples/glsl_parser_test/ReadMe.txt
@@ -0,0 +1,3 @@
+This directory holds example test files that can be registered with Piglit
+with ``add_glsl_parser_test()``. For a decription of the the test's
+behavior and file format, see the docstrings in file glsl_parser_test.py.
diff --git a/examples/glsl_parser_test/bit-logic-assign.frag b/examples/glsl_parser_test/bit-logic-assign.frag
new file mode 100644
index 000000000..78eff0f4d
--- /dev/null
+++ b/examples/glsl_parser_test/bit-logic-assign.frag
@@ -0,0 +1,21 @@
+// The config section below is required.
+//
+// [config]
+// # The config section may contain comments.
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+//
+// 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/examples/glsl_parser_test/bit-logic.vert b/examples/glsl_parser_test/bit-logic.vert
new file mode 100644
index 000000000..9b7ffedd5
--- /dev/null
+++ b/examples/glsl_parser_test/bit-logic.vert
@@ -0,0 +1,18 @@
+/* The config section below is required.
+ *
+ * [config]
+ * # The config section may contain comments.
+ * expect_result: fail
+ * glsl_version: 1.30
+ * [end config]
+ *
+ * Description: bit-and 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 = int(7) & uint(1);
+}