1 // RUN: %clang_cc1 -triple i386-unknown-unknown -O3 %s -emit-llvm -o - | FileCheck %s
49 static int foo4(int i
) {
66 // CHECK-LABEL: define{{.*}} i32 @foo4t()
70 // 111 + 1 + 222 + 42 = 376
71 return foo4(111) + foo4(99) + foo4(222) + foo4(601);
74 // CHECK-LABEL: define{{.*}} void @foo5()
86 // CHECK-LABEL: define{{.*}} void @foo6()
94 // CHECK-LABEL: define{{.*}} void @foo7()
104 // CHECK-LABEL: define{{.*}} i32 @f8(
111 case 0xFFFFFFFF ... 1: // This range should be empty because x is unsigned.
116 // Ensure that default after a case range is not ignored.
118 // CHECK-LABEL: define{{.*}} i32 @f9()
121 static int f9_0(unsigned x
) {
123 case 10 ... 0xFFFFFFFF:
133 // Ensure that this doesn't compile to infinite loop in g() due to
134 // miscompilation of fallthrough from default to a (tested) case
137 // CHECK-LABEL: define{{.*}} i32 @f10()
140 static int f10_0(unsigned x
) {
144 case 10 ... 0xFFFFFFFF:
154 // This generated incorrect code because of poor switch chaining.
156 // CHECK-LABEL: define{{.*}} i32 @f11(
163 case 10 ... 0xFFFFFFFF:
168 // This just asserted because of the way case ranges were calculated.
170 // CHECK-LABEL: define{{.*}} i32 @f12(
182 // Make sure return is not constant (if empty range is skipped or miscompiled)
184 // CHECK-LABEL: define{{.*}} i32 @f13(
187 int f13(unsigned x
) {
190 // fallthrough empty range
198 // Don't delete a basic block that we want to introduce later references to.
199 // This isn't really specific to switches, but it's easy to show with them.
200 // rdar://problem/8837067
204 // case range so that the case block has no predecessors
206 // any expression which doesn't introduce a new block