blob: f80b599ed5a037600aefa4209a630cfa5ead8e28 [file] [log] [blame]
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00001// RUN: clang-cc -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
2// RUN: grep "ret i32" %t | count 2
Daniel Dunbar16f23572008-07-25 01:11:38 +00003// 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}