OSDN Git Service

glcpp: Add new test showing bug where a trailing ':' prevents macro expansion
authorCarl Worth <cworth@cworth.org>
Sat, 21 Jan 2012 17:22:24 +0000 (09:22 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 2 Feb 2012 20:05:21 +0000 (12:05 -0800)
This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

https://bugs.freedesktop.org/show_bug.cgi?id=44764

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glcpp/tests/100-macro-with-colon.c [new file with mode: 0644]
src/glsl/glcpp/tests/100-macro-with-colon.c.expected [new file with mode: 0644]

diff --git a/src/glsl/glcpp/tests/100-macro-with-colon.c b/src/glsl/glcpp/tests/100-macro-with-colon.c
new file mode 100644 (file)
index 0000000..31dbb9a
--- /dev/null
@@ -0,0 +1,7 @@
+#define one 1
+#define two 2
+
+switch (1) {
+   case one + two:
+      break;
+}
diff --git a/src/glsl/glcpp/tests/100-macro-with-colon.c.expected b/src/glsl/glcpp/tests/100-macro-with-colon.c.expected
new file mode 100644 (file)
index 0000000..6cfac25
--- /dev/null
@@ -0,0 +1,8 @@
+
+
+
+switch (1) {
+ case 1 + 2:
+ break;
+}
+