[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / test / Transforms / SimplifyCFG / FoldValueComparisonIntoPredecessors-no-new-successors.ll
blob3fbd5bfe4574b28e483084b3795e693ad9407a6b
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-range-to-icmp < %s | FileCheck %s
4 define void @widget(i32 %arg) {
5 ; CHECK-LABEL: @widget(
6 ; CHECK-NEXT:  bb:
7 ; CHECK-NEXT:    [[SWITCH:%.*]] = icmp ult i32 [[ARG:%.*]], 2
8 ; CHECK-NEXT:    br i1 [[SWITCH]], label [[COMMON_RET:%.*]], label [[INFLOOP:%.*]]
9 ; CHECK:       common.ret:
10 ; CHECK-NEXT:    ret void
11 ; CHECK:       infloop:
12 ; CHECK-NEXT:    br label [[INFLOOP]]
14 bb:
15   %tmp = icmp eq i32 %arg, 0
16   br i1 %tmp, label %bb2, label %bb1
18 bb1:                                              ; preds = %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 [
24   i32 0, label %bb9
25   ]
27 bb2:
28   ret void
30 bb6:                                              ; preds = %bb1
31   ret void
33 bb9:                                              ; preds = %bb5
34   ret void