Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / expr_define_expansion.c
blob23cb4355eb8c672829b33a37e9cfb682d44dcde4
1 // RUN: %clang_cc1 %s -E -CC -verify
2 // RUN: %clang_cc1 %s -E -CC -DPEDANTIC -pedantic -verify
4 #define FOO && 1
5 #if defined FOO FOO
6 #endif
8 #define A
9 #define B defined(A)
10 #if B // expected-warning{{macro expansion producing 'defined' has undefined behavior}}
11 #endif
13 #define m_foo
14 #define TEST(a) (defined(m_##a) && a)
16 #if defined(PEDANTIC)
17 // expected-warning@+4{{macro expansion producing 'defined' has undefined behavior}}
18 #endif
20 // This shouldn't warn by default, only with pedantic:
21 #if TEST(foo)
22 #endif
25 // Only one diagnostic for this case:
26 #define INVALID defined(
27 #if INVALID // expected-error{{macro name missing}}
28 #endif