Rafael Espindola | 96e7813 | 2013-07-04 16:16:58 +0000 | [diff] [blame] | 1 | // RUN: not %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s |
Chris Lattner | 920bf45 | 2010-07-17 16:24:30 +0000 | [diff] [blame] | 2 | |
Chris Lattner | 3f1cc83 | 2008-02-07 06:03:59 +0000 | [diff] [blame] | 3 | // This horrible stuff should preprocess into (other than whitespace): |
| 4 | // int foo; |
| 5 | // int bar; |
| 6 | // int baz; |
| 7 | |
| 8 | int foo; |
| 9 | |
Edward O'Callaghan | b396a37 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 10 | // CHECK: int foo; |
| 11 | |
Chris Lattner | 3f1cc83 | 2008-02-07 06:03:59 +0000 | [diff] [blame] | 12 | #define comment /##/ dead tokens live here |
| 13 | comment This is stupidity |
| 14 | |
| 15 | int bar; |
| 16 | |
Edward O'Callaghan | b396a37 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 17 | // CHECK: int bar; |
| 18 | |
Chris Lattner | 3f1cc83 | 2008-02-07 06:03:59 +0000 | [diff] [blame] | 19 | #define nested(x) int x comment cute little dead tokens... |
| 20 | |
| 21 | nested(baz) rise of the dead tokens |
| 22 | |
| 23 | ; |
| 24 | |
Edward O'Callaghan | b396a37 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 25 | // CHECK: int baz |
| 26 | // CHECK: ; |
| 27 | |
Chris Lattner | 920bf45 | 2010-07-17 16:24:30 +0000 | [diff] [blame] | 28 | |
| 29 | // rdar://8197149 - VC++ allows invalid token pastes: (##baz |
| 30 | #define foo(x) abc(x) |
| 31 | #define bar(y) foo(##baz(y)) |
| 32 | bar(q) |
| 33 | |
| 34 | // CHECK: abc(baz(q)) |