blob: 61c073204cadf3e5e6b98249a20c9158673a0b75 [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
Chris Lattner89c33312008-05-04 07:15:21 +000023// PR2279
24#if 0 ? 1/0: 2
25#else
26#error
27#endif
28
29
Chris Lattner4b009652007-07-25 00:24:17 +000030#else
31
32
33/* The 1/0 is live, it should error out. */
34#if 0 && 1 ? 4 : 1 / 0
35baz
36#endif
37
38
39#endif