summaryrefslogtreecommitdiff
path: root/clang/test/Preprocessor/macro_fn_preexpand.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Preprocessor/macro_fn_preexpand.c')
-rw-r--r--clang/test/Preprocessor/macro_fn_preexpand.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/macro_fn_preexpand.c b/clang/test/Preprocessor/macro_fn_preexpand.c
new file mode 100644
index 0000000..1b94c82
--- /dev/null
+++ b/clang/test/Preprocessor/macro_fn_preexpand.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -E | grep 'pre: 1 1 X'
+// RUN: %clang_cc1 %s -E | grep 'nopre: 1A(X)'
+
+/* Preexpansion of argument. */
+#define A(X) 1 X
+pre: A(A(X))
+
+/* The ## operator disables preexpansion. */
+#undef A
+#define A(X) 1 ## X
+nopre: A(A(X))
+