aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2016-01-18 12:16:48 +0200
committerEmil Velikov <[email protected]>2016-01-26 16:08:33 +0000
commiteb63640c1d38a200a7b1540405051d3ff79d0d8a (patch)
treeda46321a41f309b1d02aeb14d5d5487791c45aeb /src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
parenta39a8fbbaa129f4e52f2a3ad2747182e9a74d910 (diff)
glsl: move to compiler/
Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c')
-rw-r--r--src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c b/src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
new file mode 100644
index 00000000000..a7c053bb402
--- /dev/null
+++ b/src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
@@ -0,0 +1,24 @@
+/* This works. */
+#define foo(a) (a)
+#define bar two,words
+foo(bar)
+
+/* So does this. */
+#define foo2(a,b) (a separate b)
+#define foo2_wrap(a) foo2(a)
+foo2_wrap(bar)
+
+/* But this generates an error. */
+#define foo_wrap(a) foo(a)
+foo_wrap(bar)
+
+/* Adding parentheses to foo_wrap fixes it. */
+#define foo_wrap_parens(a) foo((a))
+foo_wrap_parens(bar)
+
+/* As does adding parentheses to bar */
+#define bar_parens (two,words)
+foo_wrap(bar_parens)
+foo_wrap_parens(bar_parens)
+
+