unreachable code: don't warn about empty statements
[smatch.git] / validation / sm_compound_conditions2.c
blobddcd6473b247bef373971b94699328b427732224
1 #include "check_debug.h"
3 int aaa;
4 int x, y, z;
6 void func (void)
8 aaa = 0;
9 if (y)
10 aaa = 1;
11 if (x)
12 aaa = 2;
14 if (x) {
15 __smatch_value("aaa");
16 if (y)
17 __smatch_value("aaa");
18 else
19 __smatch_value("aaa");
21 if (!x) {
22 __smatch_value("aaa");
23 if (y)
24 __smatch_value("aaa");
25 else
26 __smatch_value("aaa");
28 if (y) {
29 __smatch_value("aaa");
30 if (x)
31 __smatch_value("aaa");
32 else
33 __smatch_value("aaa");
35 if (!y) {
36 __smatch_value("aaa");
37 if (x)
38 __smatch_value("aaa");
39 else
40 __smatch_value("aaa");
42 if (x && y)
43 __smatch_value("aaa");
44 if (x || y)
45 __smatch_value("aaa");
46 else
47 __smatch_value("aaa");
48 if (!x && !y)
49 __smatch_value("aaa");
52 * check-name: Compound Conditions #2
53 * check-command: smatch -I.. sm_compound_conditions2.c
55 * check-output-start
56 sm_compound_conditions2.c:15 func() aaa = 2
57 sm_compound_conditions2.c:17 func() aaa = 2
58 sm_compound_conditions2.c:19 func() aaa = 2
59 sm_compound_conditions2.c:22 func() aaa = 0-1
60 sm_compound_conditions2.c:24 func() aaa = 1
61 sm_compound_conditions2.c:26 func() aaa = 0
62 sm_compound_conditions2.c:29 func() aaa = 1-2
63 sm_compound_conditions2.c:31 func() aaa = 2
64 sm_compound_conditions2.c:33 func() aaa = 1
65 sm_compound_conditions2.c:36 func() aaa = 0,2
66 sm_compound_conditions2.c:38 func() aaa = 2
67 sm_compound_conditions2.c:40 func() aaa = 0
68 sm_compound_conditions2.c:43 func() aaa = 2
69 sm_compound_conditions2.c:45 func() aaa = 1-2
70 sm_compound_conditions2.c:47 func() aaa = 0
71 sm_compound_conditions2.c:49 func() aaa = 0
72 * check-output-end