Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -E -dM %s -o %t && |
Chris Lattner | f73903a | 2009-02-06 06:45:26 +0000 | [diff] [blame] | 2 | |
| 3 | // Space even without expansion tokens |
| 4 | // RUN: grep "#define A(x) " %t && |
| 5 | #define A(x) |
| 6 | |
| 7 | // Space before expansion list. |
| 8 | // RUN: grep "#define B(x,y) x y" %t && |
| 9 | #define B(x,y)x y |
| 10 | |
| 11 | // No space in expansion list. |
| 12 | // RUN: grep "#define C(x,y) x y" %t && |
| 13 | #define C(x, y) x y |
| 14 | |
| 15 | // No paste avoidance. |
| 16 | // RUN: grep "#define X() .." %t && |
| 17 | #define X() .. |
| 18 | |
| 19 | // Simple test. |
| 20 | // RUN: grep "#define Y ." %t && |
| 21 | // RUN: grep "#define Z X()Y" %t && |
| 22 | #define Y . |
| 23 | #define Z X()Y |
| 24 | |
| 25 | // gcc prints macros at end of translation unit, so last one wins. |
| 26 | // RUN: grep "#define foo 2" %t && |
| 27 | // RUN: not grep "#define foo 1" %t |
| 28 | #define foo 1 |
| 29 | #undef foo |
| 30 | #define foo 2 |
| 31 | |