Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / _Pragma-in-macro-arg.c
blobfea44d17388256f83228ba31e3f9b3723c3eed47
1 // RUN: %clang_cc1 %s -verify -Wconversion
3 // Don't crash
4 #define A(desc) _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wparentheses\"") _Pragma("clang diagnostic pop")
5 #define B(desc) A(desc)
6 B(_Pragma("clang diagnostic ignored \"-Wparentheses\""))
9 #define EMPTY(x)
10 #define INACTIVE(x) EMPTY(x)
12 #define ID(x) x
13 #define ACTIVE(x) ID(x)
15 // This should be ignored..
16 INACTIVE(_Pragma("clang diagnostic ignored \"-Wconversion\""))
18 #define IGNORE_CONV _Pragma("clang diagnostic ignored \"-Wconversion\"") _Pragma("clang diagnostic ignored \"-Wconversion\"")
20 // ..as should this.
21 INACTIVE(IGNORE_CONV)
23 #define IGNORE_POPPUSH(Pop, Push, W, D) Push W D Pop
24 IGNORE_POPPUSH(_Pragma("clang diagnostic pop"), _Pragma("clang diagnostic push"),
25 _Pragma("clang diagnostic ignored \"-Wconversion\""), int q = (double)1.0);
27 int x1 = (double)1.0; // expected-warning {{implicit conversion}}
29 ACTIVE(_Pragma) ("clang diagnostic ignored \"-Wconversion\"")) // expected-error {{_Pragma takes a parenthesized string literal}} \
30 expected-error {{expected identifier or '('}} expected-error {{expected ')'}} expected-note {{to match this '('}}
32 // This should disable the warning.
33 ACTIVE(IGNORE_CONV)
35 int x2 = (double)1.0;