summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/glcpp/tests')
-rw-r--r--src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c8
-rw-r--r--src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c b/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c
new file mode 100644
index 00000000000..167d3c8a3cf
--- /dev/null
+++ b/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c
@@ -0,0 +1,8 @@
+/* The body can include C expressions with ++ and -- */
+a = x++;
+b = ++x;
+c = x--;
+d = --x;
+/* But these are not legal in preprocessor expressions. */
+#if x++ > 4
+#endif
diff --git a/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected b/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected
new file mode 100644
index 00000000000..137921b1695
--- /dev/null
+++ b/src/glsl/glcpp/tests/136-plus-plus-and-minus-minus.c.expected
@@ -0,0 +1,8 @@
+0:7(12): preprocessor error: syntax error, unexpected PLUS_PLUS
+
+a = x++;
+b = ++x;
+c = x--;
+d = --x;
+
+