2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -Eonly -Werror=undef -verify
|
|
|
|
// RUN: %clang_cc1 %s -Eonly -Werror-undef -verify
|
2008-01-24 01:19:46 +08:00
|
|
|
|
2009-04-18 09:33:54 +08:00
|
|
|
extern int x;
|
|
|
|
|
|
|
|
#if foo // expected-error {{'foo' is not defined, evaluates to 0}}
|
2008-01-24 01:19:46 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef foo
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(foo)
|
|
|
|
#endif
|
|
|
|
|
2009-04-18 09:34:22 +08:00
|
|
|
|
|
|
|
// PR3938
|
|
|
|
#if 0
|
|
|
|
#ifdef D
|
|
|
|
#else 1 // Should not warn due to C99 6.10p4
|
|
|
|
#endif
|
|
|
|
#endif
|