summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-29 04:39:12 +0000
committerChris Lattner <sabre@nondot.org>2006-07-29 04:39:12 +0000
commitd480b9c0ed26c3f30dda96a10211cbfee24235b4 (patch)
tree2338ee137a9197aee346fb4f7f8ebd75a8c771a4
parent479b0af31db7dedc79732f4c1ac7510d9fc8bbd4 (diff)
downloadbcm5719-llvm-d480b9c0ed26c3f30dda96a10211cbfee24235b4.tar.gz
bcm5719-llvm-d480b9c0ed26c3f30dda96a10211cbfee24235b4.zip
new testcase for the GNU comma swallow extension.
llvm-svn: 38779
-rw-r--r--clang/test/Preprocessor/macro_fn_comma_swallow.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/macro_fn_comma_swallow.c b/clang/test/Preprocessor/macro_fn_comma_swallow.c
new file mode 100644
index 00000000000..d4f3bb9940d
--- /dev/null
+++ b/clang/test/Preprocessor/macro_fn_comma_swallow.c
@@ -0,0 +1,16 @@
+// Test the GNU comma swallowing extension.
+// RUN: clang %s -E | grep 'foo{A, }' &&
+// RUN: clang %s -E | grep 'fo2{A,}' &&
+// RUN: clang %s -E | grep '{foo}'
+
+#define X(Y) foo{A, Y}
+X()
+
+#define X2(Y) fo2{A,##Y}
+X2()
+
+// should eat the comma.
+#define X3(b, ...) {b, ## __VA_ARGS__}
+X3(foo)
+
+
OpenPOWER on IntegriCloud