Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -E %s | grep 'noexp: foo y' |
| 2 | // RUN: clang-cc -E %s | grep 'expand: abc' |
| 3 | // RUN: clang-cc -E %s | grep 'noexp2: foo nonexp' |
Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 4 | // RUN: clang-cc -E %s | grep 'expand2: abc' |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 5 | |
| 6 | #define A foo |
| 7 | #define foo() abc |
| 8 | #define X A y |
| 9 | |
| 10 | // This should not expand to abc, because the foo macro isn't followed by (. |
| 11 | noexp: X |
| 12 | |
| 13 | |
| 14 | // This should expand to abc. |
| 15 | #undef X |
| 16 | #define X A () |
| 17 | expand: X |
| 18 | |
| 19 | |
| 20 | // This should be 'foo nonexp' |
| 21 | noexp2: A nonexp |
| 22 | |
| 23 | // This should expand |
| 24 | expand2: A ( |
| 25 | ) |
| 26 | |
| 27 | |