1 // RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s
3 // PR9322 and rdar://6970405
8 // CHECK: add nsw i32 {{.*}}, 1
29 // CHECK: add nsw i32 {{.*}}, 2
40 // Fall off the end of the switch.
48 // CHECK: add nsw i32 {{.*}}, 2
67 // CHECK: add nsw i32 {{.*}}, 2
83 // This shouldn't crash codegen, but we don't have to optimize out the switch
87 int x
; // eliding var decl?
100 // Neither case is reachable.
115 // CHECK: add nsw i32
125 case 4: // crazy brace scenario
135 // CHECK: add nsw i32
146 // Fall off the end of the switch.
153 // CHECK: add nsw i32
154 // CHECK: add nsw i32
164 // Fall through is fine.
195 int x
; // eliding var decl?
207 int a
; // Ok to skip this vardecl.
213 int x
; // eliding var decl?
219 // Verify that case 42 only calls test14 once.
221 // CHECK: call void @test13(i32 noundef 97)
222 // CHECK-NEXT: br label %[[EPILOG2:[0-9.a-z]+]]
223 // CHECK: [[EPILOG2]]
224 // CHECK-NEXT: br label [[EPILOG:%[0-9.a-z]+]]
225 // CHECK: call void @test13(i32 noundef 42)
226 // CHECK-NEXT: br label [[EPILOG]]
229 case 42: test13(97); // fallthrough
231 default: test13(42); break;