// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 %s -emit-llvm -o - | FileCheck %s
int
int
int
static int
// CHECK-LABEL: define{{.*}} i32 @foo4t()
// CHECK: ret i32 376
// CHECK: }
int
// CHECK-LABEL: define{{.*}} void @foo5()
// CHECK-NOT: switch
// CHECK: }
void
// CHECK-LABEL: define{{.*}} void @foo6()
// CHECK-NOT: switch
// CHECK: }
void
// CHECK-LABEL: define{{.*}} void @foo7()
// CHECK-NOT: switch
// CHECK: }
void
// CHECK-LABEL: define{{.*}} i32 @f8(
// CHECK: ret i32 3
// CHECK: }
int
// Ensure that default after a case range is not ignored.
//
// CHECK-LABEL: define{{.*}} i32 @f9()
// CHECK: ret i32 10
// CHECK: }
static int
int
// Ensure that this doesn't compile to infinite loop in g() due to
// miscompilation of fallthrough from default to a (tested) case
// range.
//
// CHECK-LABEL: define{{.*}} i32 @f10()
// CHECK: ret i32 10
// CHECK: }
static int
int
// This generated incorrect code because of poor switch chaining.
//
// CHECK-LABEL: define{{.*}} i32 @f11(
// CHECK: ret i32 3
// CHECK: }
int
// This just asserted because of the way case ranges were calculated.
//
// CHECK-LABEL: define{{.*}} i32 @f12(
// CHECK: ret i32 3
// CHECK: }
int
// Make sure return is not constant (if empty range is skipped or miscompiled)
//
// CHECK-LABEL: define{{.*}} i32 @f13(
// CHECK: ret i32 %
// CHECK: }
int
// Don't delete a basic block that we want to introduce later references to.
// This isn't really specific to switches, but it's easy to show with them.
// rdar://problem/8837067
int