Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -Eonly -Werror=undef -verify |
| 2 | // RUN: %clang_cc1 %s -Eonly -Werror-undef -verify |
Chris Lattner | 116a4b1 | 2008-01-23 17:19:46 +0000 | [diff] [blame] | 3 | |
Chris Lattner | ae7cbf1 | 2009-04-18 01:33:54 +0000 | [diff] [blame] | 4 | extern int x; |
| 5 | |
| 6 | #if foo // expected-error {{'foo' is not defined, evaluates to 0}} |
Chris Lattner | 116a4b1 | 2008-01-23 17:19:46 +0000 | [diff] [blame] | 7 | #endif |
| 8 | |
| 9 | #ifdef foo |
| 10 | #endif |
| 11 | |
| 12 | #if defined(foo) |
| 13 | #endif |
| 14 | |
Chris Lattner | 8fe00e7 | 2009-04-18 01:34:22 +0000 | [diff] [blame] | 15 | |
| 16 | // PR3938 |
| 17 | #if 0 |
| 18 | #ifdef D |
| 19 | #else 1 // Should not warn due to C99 6.10p4 |
| 20 | #endif |
| 21 | #endif |
Chris Lattner | 1c6c64b | 2010-04-16 23:44:05 +0000 | [diff] [blame] | 22 | |
Argyrios Kyrtzidis | e26224e | 2011-05-21 04:26:04 +0000 | [diff] [blame] | 23 | // rdar://9475098 |
| 24 | #if 0 |
| 25 | #else 1 // expected-warning {{extra tokens}} |
| 26 | #endif |
Chris Lattner | 1c6c64b | 2010-04-16 23:44:05 +0000 | [diff] [blame] | 27 | |
| 28 | // PR6852 |
| 29 | #if 'somesillylongthing' // expected-warning {{character constant too long for its type}} \ |
| 30 | // expected-warning {{multi-character character constant}} |
| 31 | #endif |