aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-30 13:38:46 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-30 13:38:46 +0000
commitc30981a563a8947cb26b1e308d122fa2ef90fceb (patch)
treebe7c0367d7be45d668115cc556982c847b875867 /test
parent3bc22262af7b09a459b400976cfce3d9318b8ea9 (diff)
Make preprocessor act in a GCC-compatible fashion when a macro is redefined
within its own argument list. The original definition is used for the immediate expansion, but the new definition is used for any subsequent occurences within the argument list or after the expansion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Preprocessor/macro_arg_directive.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Preprocessor/macro_arg_directive.c b/test/Preprocessor/macro_arg_directive.c
index 5c9943d605..5bc2236f0c 100644
--- a/test/Preprocessor/macro_arg_directive.c
+++ b/test/Preprocessor/macro_arg_directive.c
@@ -1,5 +1,12 @@
// RUN: %clang_cc1 %s -fsyntax-only -verify
+#define a(x) enum { x }
+a(n =
+#undef a
+#define a 5
+ a);
+_Static_assert(n == 5, "");
+
// header1.h
void fail(const char *);
#define MUNCH(...) \