diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-14 05:00:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-14 05:00:18 +0000 |
commit | a3e008abc51933d567303a1b4bd17e68c798f60e (patch) | |
tree | c9b74d5cb4480367e0b4ba316ccc90941e8b027c /test/Preprocessor/macro_fn_disable_expand.c | |
parent | 0dcfbc5879694debfa83520ec09635d51afdf9de (diff) |
fix rdar://7466570 - Be more bug compatible with GCC when it comes to
expanding directives withing macro expansions. This is undefined behavior
according to 6.10.3p11, so we might as well be undefined in ways similar to
GCC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor/macro_fn_disable_expand.c')
-rw-r--r-- | test/Preprocessor/macro_fn_disable_expand.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Preprocessor/macro_fn_disable_expand.c b/test/Preprocessor/macro_fn_disable_expand.c index 2c24d696d5..e2c666e6a2 100644 --- a/test/Preprocessor/macro_fn_disable_expand.c +++ b/test/Preprocessor/macro_fn_disable_expand.c @@ -8,3 +8,23 @@ foo(foo) (2) #define w ABCD m(m) // CHECK: m(ABCD) + + + +// rdar://7466570 + +// We should get '42' in the argument list for gcc compatibility. +#define A 1 +#define B 2 +#define C(x) (x + 1) + +X: C( +#ifdef A +#if A == 1 +#if B + 42 +#endif +#endif +#endif + ) +// CHECK: X: (42 + 1) |