brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 29bbd5a Raw
45 lines · c
1// RUN: %clang_cc1 -verify -fms-extensions -Wmicrosoft %s2// RUN: not %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s3 4// This horrible stuff should preprocess into (other than whitespace):5//   int foo;6//   int bar;7//   int baz;8 9int foo;10 11// CHECK: int foo;12 13#define comment /##/  dead tokens live here14// expected-warning@+1 {{pasting two '/' tokens}}15comment This is stupidity16 17int bar;18 19// CHECK: int bar;20 21#define nested(x) int x comment cute little dead tokens...22 23// expected-warning@+1 {{pasting two '/' tokens}}24nested(baz)  rise of the dead tokens25 26;27 28// CHECK: int baz29// CHECK: ;30 31 32// VC++ allows invalid token pastes: (##baz33#define foo(x) abc(x)34#define bar(y) foo(##baz(y))35bar(q) // expected-error {{type specifier missing}} expected-error {{invalid preprocessing token}} expected-error {{parameter list without types}}36 37// CHECK: abc(baz(q))38 39 40#define str(x) #x41#define collapse_spaces(a, b, c, d) str(a ## - ## b ## - ## c ## d)42collapse_spaces(1a, b2, 3c, d4) // expected-error 4 {{invalid preprocessing token}} expected-error {{expected function body}}43 44// CHECK: "1a-b2-3cd4"45