blob: ca5ff1b712255c8de7fff0b83e395ac10b9b4142 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t &&
Daniel Dunbar16f23572008-07-25 01:11:38 +00002// RUN: grep "ret i32" %t | count 2 &&
3// RUN: grep "ret i32 3" %t | count 2
4
5// This generated incorrect code because of poor switch chaining.
6int f1(int x) {
7 switch(x) {
8 default:
9 return 3;
10 case 10 ... 0xFFFFFFFF:
11 return 0;
12 }
13}
14
15// This just asserted because of the way case ranges were calculated.
16int f2(int x) {
17 switch (x) {
18 default:
19 return 3;
20 case 10 ... -1:
21 return 0;
22 }
23}