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 | 4c53c40a4cbd893d43ec823c95b6da25245dfc2f (patch) | |
tree | 3ef01b0925a41a401afa269d5df7d9787a65d43d /clang/test/Preprocessor/macro_fn_disable_expand.c | |
parent | b8132253c8e3b8930e28b63227deb31d20809072 (diff) | |
download | bcm5719-llvm-4c53c40a4cbd893d43ec823c95b6da25245dfc2f.tar.gz bcm5719-llvm-4c53c40a4cbd893d43ec823c95b6da25245dfc2f.zip |
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.
llvm-svn: 91266
Diffstat (limited to 'clang/test/Preprocessor/macro_fn_disable_expand.c')
-rw-r--r-- | clang/test/Preprocessor/macro_fn_disable_expand.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/macro_fn_disable_expand.c b/clang/test/Preprocessor/macro_fn_disable_expand.c index 2c24d696d52..e2c666e6a28 100644 --- a/clang/test/Preprocessor/macro_fn_disable_expand.c +++ b/clang/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) |