1 // RUN: %clang_cc1 %s -Eonly -verify 2 3 // This should not be rejected. 4 #ifdef defined 5 #elifdef defined 6 #endif 7 8 9 10 // PR3764 11 12 // This should not produce a redefinition warning. 13 #define FUNC_LIKE(a) (a) 14 #define FUNC_LIKE(a)(a) 15 16 // This either. 17 #define FUNC_LIKE2(a)\ 18 (a) 19 #define FUNC_LIKE2(a) (a) 20 21 // This should. 22 #define FUNC_LIKE3(a) ( a) // expected-note {{previous definition is here}} 23 #define FUNC_LIKE3(a) (a) // expected-warning {{'FUNC_LIKE3' macro redefined}} 24 25 // RUN: %clang_cc1 -fms-extensions -DMS_EXT %s -Eonly -verify 26 #ifndef MS_EXT 27 // This should under C99. 28 #define FUNC_LIKE4(a,b) (a+b) // expected-note {{previous definition is here}} 29 #define FUNC_LIKE4(x,y) (x+y) // expected-warning {{'FUNC_LIKE4' macro redefined}} 30 #else 31 // This shouldn't under MS extensions. 32 #define FUNC_LIKE4(a,b) (a+b) 33 #define FUNC_LIKE4(x,y) (x+y) 34 35 // This should. 36 #define FUNC_LIKE5(a,b) (a+b) // expected-note {{previous definition is here}} 37 #define FUNC_LIKE5(x,y) (y+x) // expected-warning {{'FUNC_LIKE5' macro redefined}} 38 #endif 39