[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Preprocessor / macro_misc.c
blobf80ab7144d54439ed812e13219c2de9706485642
1 // RUN: %clang_cc1 %s -Eonly -verify
3 // This should not be rejected.
4 #ifdef defined
5 #elifdef defined
6 #endif
7 // expected-warning@-2 {{use of a '#elifdef' directive is a C2x extension}}
11 // PR3764
13 // This should not produce a redefinition warning.
14 #define FUNC_LIKE(a) (a)
15 #define FUNC_LIKE(a)(a)
17 // This either.
18 #define FUNC_LIKE2(a)\
19 (a)
20 #define FUNC_LIKE2(a) (a)
22 // This should.
23 #define FUNC_LIKE3(a) ( a) // expected-note {{previous definition is here}}
24 #define FUNC_LIKE3(a) (a) // expected-warning {{'FUNC_LIKE3' macro redefined}}
26 // RUN: %clang_cc1 -fms-extensions -DMS_EXT %s -Eonly -verify
27 #ifndef MS_EXT
28 // This should under C99.
29 #define FUNC_LIKE4(a,b) (a+b) // expected-note {{previous definition is here}}
30 #define FUNC_LIKE4(x,y) (x+y) // expected-warning {{'FUNC_LIKE4' macro redefined}}
31 #else
32 // This shouldn't under MS extensions.
33 #define FUNC_LIKE4(a,b) (a+b)
34 #define FUNC_LIKE4(x,y) (x+y)
36 // This should.
37 #define FUNC_LIKE5(a,b) (a+b) // expected-note {{previous definition is here}}
38 #define FUNC_LIKE5(x,y) (y+x) // expected-warning {{'FUNC_LIKE5' macro redefined}}
39 #endif