[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Preprocessor / macro_paste_msextensions.c
blob1549ff5e55620ba93dd230b4be7c23e6d60e9cd2
1 // RUN: %clang_cc1 -verify -fms-extensions -Wmicrosoft %s
2 // RUN: not %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s
4 // This horrible stuff should preprocess into (other than whitespace):
5 // int foo;
6 // int bar;
7 // int baz;
9 int foo;
11 // CHECK: int foo;
13 #define comment /##/ dead tokens live here
14 // expected-warning@+1 {{pasting two '/' tokens}}
15 comment This is stupidity
17 int bar;
19 // CHECK: int bar;
21 #define nested(x) int x comment cute little dead tokens...
23 // expected-warning@+1 {{pasting two '/' tokens}}
24 nested(baz) rise of the dead tokens
28 // CHECK: int baz
29 // CHECK: ;
32 // rdar://8197149 - VC++ allows invalid token pastes: (##baz
33 #define foo(x) abc(x)
34 #define bar(y) foo(##baz(y))
35 bar(q) // expected-error {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}}
37 // CHECK: abc(baz(q))
40 #define str(x) #x
41 #define collapse_spaces(a, b, c, d) str(a ## - ## b ## - ## c ## d)
42 collapse_spaces(1a, b2, 3c, d4) // expected-error 4 {{invalid preprocessing token}} expected-error {{expected function body}}
44 // CHECK: "1a-b2-3cd4"