blob: 345ac95eb4ba8765bbffd3042b827e8b30db9b13 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -Eonly -Werror=undef -verify
2// RUN: %clang_cc1 %s -Eonly -Werror-undef -verify
Chris Lattner116a4b12008-01-23 17:19:46 +00003
Chris Lattnerae7cbf12009-04-18 01:33:54 +00004extern int x;
5
6#if foo // expected-error {{'foo' is not defined, evaluates to 0}}
Chris Lattner116a4b12008-01-23 17:19:46 +00007#endif
8
9#ifdef foo
10#endif
11
12#if defined(foo)
13#endif
14
Chris Lattner8fe00e72009-04-18 01:34:22 +000015
16// PR3938
17#if 0
18#ifdef D
19#else 1 // Should not warn due to C99 6.10p4
20#endif
21#endif
Chris Lattner1c6c64b2010-04-16 23:44:05 +000022
23
24// PR6852
25#if 'somesillylongthing' // expected-warning {{character constant too long for its type}} \
26 // expected-warning {{multi-character character constant}}
27#endif