forked from OSchip/llvm-project
[StaticAnalyser] Add test case to ensure that unreachable code is found.
https://reviews.llvm.org/D24905 llvm-svn: 283096
This commit is contained in:
parent
042a3c5a2d
commit
fd1b3814b3
|
@ -161,7 +161,7 @@ void testInlined() {
|
|||
|
||||
// Don't warn about unreachable VarDecl.
|
||||
void dostuff(int*A);
|
||||
void varDecl(int X) {
|
||||
void varDecl1(int X) {
|
||||
switch (X) {
|
||||
int A; // No warning here.
|
||||
case 1:
|
||||
|
@ -172,6 +172,17 @@ void varDecl(int X) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
void varDecl2(int X) {
|
||||
switch (X) {
|
||||
int A=1; // expected-warning {{never executed}}
|
||||
case 1:
|
||||
dostuff(&A);
|
||||
break;
|
||||
case 2:
|
||||
dostuff(&A);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that ExplodedGraph and unoptimized CFG match.
|
||||
void test12(int x) {
|
||||
|
|
Loading…
Reference in New Issue