blob: 7cb9384cdeafc51c164f5ac2c2050fc299c085bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// RUN: clang --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
// RUN: grep "ret i32 10" %t
// Ensure that this doesn't compile to infinite loop in g() due to
// miscompilation of fallthrough from default to a (tested) case
// range.
static int f0(unsigned x) {
switch(x) {
default:
x += 1;
case 10 ... 0xFFFFFFFF:
return 0;
}
}
int g() {
f0(1);
return 10;
}
|