blob: 5ba4e48dfa6cdd261ab37864fa42d90e843ebd5b (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
Run me through unifdef -UA
*** Nothing should be visible here:
#if defined A && defined B
hello world
#endif
#if defined A && B
hello world
#endif
#if defined A && 1
hello world
#endif
#if defined A && (1 > 0)
hello world
#endif
#if defined B && defined A
hello world
#endif
#if B && defined A
hello world
#endif
#if 1 && defined A
hello world
#endif
#if (1 > 0) && defined A
hello world
#endif
#if defined A && (defined FOO || defined BAR)
hello world
#endif
#if (defined FOO || defined BAR) && defined A
hello world
#endif
*** Everything should be visible here, but #if/#endif removed:
#if defined B || !defined A
hello world 1
#endif
#if !defined A || defined B
hello world 2 (last)
#endif
*** This should be unchanged (#if/#endif not removed):
#if defined A || defined B
I am here 1
#endif
#if defined B || defined A
I am here 2
#endif
I am here 3
#if !defined FOO && !defined BAR \
&& !defined BAZ
# error "I am here 4"
#endif
I am here 5
#if (!defined FOO \
&& (defined BAR || defined BAZ \
|| defined XYZ))
I am here 6
#endif
I am here 7
#if !defined FOO \
&& defined BAR
I am here 8
#endif
I am here 9 (last)
*** End
|