1 | // RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wmacro-redefined -DCLI_MACRO=1 -DWMACRO_REDEFINED |
2 | // RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-macro-redefined -DCLI_MACRO=1 |
3 | |
4 | #ifndef WMACRO_REDEFINED |
5 | // expected-no-diagnostics |
6 | #endif |
7 | |
8 | #ifdef WMACRO_REDEFINED |
9 | // expected-note@1 {{previous definition is here}} |
10 | // expected-warning@+2 {{macro redefined}} |
11 | #endif |
12 | #define CLI_MACRO |
13 | |
14 | #ifdef WMACRO_REDEFINED |
15 | // expected-note@+3 {{previous definition is here}} |
16 | // expected-warning@+3 {{macro redefined}} |
17 | #endif |
18 | #define REGULAR_MACRO |
19 | #define REGULAR_MACRO 1 |
20 | |