summaryrefslogtreecommitdiff
path: root/test/Preprocessor/expr_liveness.c
blob: f14ac0a9133d0ec32e51c5342cf92be8bac87275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* RUN: clang -E %s -DNO_ERRORS &&
   RUN: not clang -E %s
 */

#ifdef NO_ERRORS
/* None of these divisions by zero are in live parts of the expression, do not
   emit any diagnostics. */

#define MACRO_0 0
#define MACRO_1 1

#if MACRO_0 && 10 / MACRO_0
foo
#endif

#if MACRO_1 || 10 / MACRO_0
bar
#endif

#if 0 ? 124/0 : 42
#endif

#else


/* The 1/0 is live, it should error out. */
#if 0 && 1 ? 4 : 1 / 0
baz
#endif


#endif