1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
7 define i32 @single_case() {
8 ; CHECK-LABEL: @single_case(
9 ; CHECK-NEXT: switch i32 add (i32 ptrtoint (ptr @g to i32), i32 -1), label [[X:%.*]] [
12 ; CHECK-NEXT: ret i32 0
14 switch i32 add (i32 ptrtoint (ptr @g to i32), i32 -1), label %x []
19 define i32 @multiple_cases() {
20 ; CHECK-LABEL: @multiple_cases(
21 ; CHECK-NEXT: switch i32 add (i32 ptrtoint (ptr @g to i32), i32 -1), label [[X:%.*]] [
22 ; CHECK-NEXT: i32 1, label [[ONE:%.*]]
23 ; CHECK-NEXT: i32 2, label [[TWO:%.*]]
26 ; CHECK-NEXT: ret i32 0
28 ; CHECK-NEXT: ret i32 1
30 ; CHECK-NEXT: ret i32 2
32 switch i32 add (i32 ptrtoint (ptr @g to i32), i32 -1), label %x [