Lines Matching +full:case +full:- +full:sensitive
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,deadcode.DeadStores,alpha.deadcode.UnreachableCod…
5 // The first few tests are non-path specific - we should be able to find them
9 a += 5; // expected-warning{{never executed}} in test()
10 case 2: in test()
12 case 3: in test()
24 foo(a); // expected-warning{{never executed}} in test2()
30 if (a > 5) { // expected-warning{{never executed}} in test3()
35 // These next tests are path-sensitive
41 a -= 2; in test4()
44 a = a + 56; // expected-warning{{never executed}} in test4()
56 bar(1); // expected-warning{{never executed}} in test5()
65 __builtin_unreachable(); // no-warning in test6()
66 __builtin_assume(0); // no-warning in test6()
69 // Compile-time constant false positives
74 return; // no-warning in test7()
77 return; // no-warning in test7()
80 return; // no-warning in test7()
87 a = 123; // no-warning in test8()
95 if (a) // expected-warning{{never executed}} in test9()
96 foo(a + 5); // no-warning in test9()
97 else // no-warning in test9()
98 foo(a); // no-warning in test9()
99 case 1: in test9()
100 case 2: in test9()
107 // Tests from flow-sensitive version
111 goto e; // expected-warning {{never executed}} in test10()
115 goto b; // expected-warning {{never executed}} in test10()
116 goto a; // expected-warning {{never executed}} in test10()
118 i = 1; // no-warning in test10()
120 i = 2; // no-warning in test10()
127 // test11: we can actually end up in the default case, even if it is not
133 case FOO: in test11()
135 case BAR: in test11()
138 error(); // no-warning in test11()
140 error(); // expected-warning {{never executed}} in test11()
146 foo(5); // no-warning in inlined()
158 foo(5); // expected-warning {{never executed}} in testInlined()
168 case 1: in varDecl1()
171 case 2: in varDecl1()
178 int A=1; // expected-warning {{never executed}} in varDecl2()
179 case 1: in varDecl2()
182 case 2: in varDecl2()
191 case 1: in test12()
193 case 2: in test12()
208 x && x < 10; // no-warning in test13()
214 RETURN(1); // no-warning in macro()