| Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -P -E -fms-extensions %s | FileCheck -strict-whitespace %s | 
| Chris Lattner | 52c00bd | 2010-07-17 16:24:30 +0000 | [diff] [blame] | 2 |  | 
| Chris Lattner | 3b5054d | 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 | f78edf5 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 10 | // CHECK: int foo; | 
|  | 11 |  | 
| Chris Lattner | 3b5054d | 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 | f78edf5 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 17 | // CHECK: int bar; | 
|  | 18 |  | 
| Chris Lattner | 3b5054d | 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 | f78edf5 | 2009-10-27 02:36:32 +0000 | [diff] [blame] | 25 | // CHECK: int baz | 
|  | 26 | // CHECK: ; | 
|  | 27 |  | 
| Chris Lattner | 52c00bd | 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)) |