summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/tests
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2010-08-11 12:43:44 -0700
committerCarl Worth <[email protected]>2010-08-11 12:43:44 -0700
commit48ba058e7a4b808271ca987b1553efd7e9792da9 (patch)
tree2c9de7e767584000ae27278b104d40ef4376c52a /src/glsl/glcpp/tests
parent298a6fcddef6a91084ae921fca0b8640eb2e2a16 (diff)
glcpp: Additional fixes for not evaluating skipped #if/#elif expressions.
This adds a couple of test cases to expand our coverage of invalid #if and being skipped, (either by being nested inside an #if/#elif that evaluates to zero or by being after an #if/#elif that evaluates to non-zero).
Diffstat (limited to 'src/glsl/glcpp/tests')
-rw-r--r--src/glsl/glcpp/tests/075-elif-elif-undef.c4
-rw-r--r--src/glsl/glcpp/tests/075-elif-elif-undef.c.expected5
-rw-r--r--src/glsl/glcpp/tests/076-elif-undef-nested.c5
-rw-r--r--src/glsl/glcpp/tests/076-elif-undef-nested.c.expected6
4 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/glcpp/tests/075-elif-elif-undef.c b/src/glsl/glcpp/tests/075-elif-elif-undef.c
new file mode 100644
index 00000000000..264bc4f10ee
--- /dev/null
+++ b/src/glsl/glcpp/tests/075-elif-elif-undef.c
@@ -0,0 +1,4 @@
+#ifndef UNDEF
+#elif UNDEF < 0
+#elif UNDEF == 3
+#endif
diff --git a/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected b/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected
new file mode 100644
index 00000000000..3f2ff2d6cc8
--- /dev/null
+++ b/src/glsl/glcpp/tests/075-elif-elif-undef.c.expected
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/glsl/glcpp/tests/076-elif-undef-nested.c b/src/glsl/glcpp/tests/076-elif-undef-nested.c
new file mode 100644
index 00000000000..ebd550ed005
--- /dev/null
+++ b/src/glsl/glcpp/tests/076-elif-undef-nested.c
@@ -0,0 +1,5 @@
+#ifdef UNDEF
+#if UNDEF == 4
+#elif UNDEF == 5
+#endif
+#endif
diff --git a/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected b/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected
new file mode 100644
index 00000000000..6fb66a5e2f0
--- /dev/null
+++ b/src/glsl/glcpp/tests/076-elif-undef-nested.c.expected
@@ -0,0 +1,6 @@
+
+
+
+
+
+