blob: f14ac0a9133d0ec32e51c5342cf92be8bac87275 [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001/* RUN: clang -E %s -DNO_ERRORS &&
2 RUN: not clang -E %s
3 */
4
5#ifdef NO_ERRORS
6/* None of these divisions by zero are in live parts of the expression, do not
7 emit any diagnostics. */
8
9#define MACRO_0 0
10#define MACRO_1 1
11
12#if MACRO_0 && 10 / MACRO_0
13foo
14#endif
15
16#if MACRO_1 || 10 / MACRO_0
17bar
18#endif
19
20#if 0 ? 124/0 : 42
21#endif
22
23#else
24
25
26/* The 1/0 is live, it should error out. */
27#if 0 && 1 ? 4 : 1 / 0
28baz
29#endif
30
31
32#endif