52 lines · c
1/* RUN: %clang_cc1 -E %s -DNO_ERRORS -Werror -Wundef2 RUN: not %clang_cc1 -E %s3 */4 5#ifdef NO_ERRORS6/* None of these divisions by zero are in live parts of the expression, do not7 emit any diagnostics. */8 9#define MACRO_0 010#define MACRO_1 111 12#if MACRO_0 && 10 / MACRO_013foo14#endif15 16#if MACRO_1 || 10 / MACRO_017bar18#endif19 20#if 0 ? 124/0 : 4221#endif22 23// PR227924#if 0 ? 1/0: 225#else26#error27#endif28 29// PR227930#if 1 ? 2 ? 3 : 4 : 531#endif32 33// PR228434#if 1 ? 0: 1 ? 1/0: 1/035#endif36 37#else38 39 40/* The 1/0 is live, it should error out. */41#if 0 && 1 ? 4 : 1 / 042baz43#endif44 45 46#endif47 48// -Wundef should not warn about use of undefined identifier if not live.49#if (!defined(XXX) || XXX > 42)50#endif51 52