1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-range-to-icmp < %s | FileCheck %s
4 define void @widget(i32 %arg) {
5 ; CHECK-LABEL: @widget(
7 ; CHECK-NEXT: [[SWITCH:%.*]] = icmp ult i32 [[ARG:%.*]], 2
8 ; CHECK-NEXT: br i1 [[SWITCH]], label [[COMMON_RET:%.*]], label [[INFLOOP:%.*]]
10 ; CHECK-NEXT: ret void
12 ; CHECK-NEXT: br label [[INFLOOP]]
15 %tmp = icmp eq i32 %arg, 0
16 br i1 %tmp, label %bb2, label %bb1
19 %tmp4 = icmp eq i32 %arg, 1
20 br i1 %tmp4, label %bb6, label %bb5
22 bb5: ; preds = %bb5, %bb5
23 switch i32 %arg, label %bb5 [