1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2 ; RUN: opt < %s -passes=loop-extract -S | FileCheck %s
4 ; This test used to enter an infinite loop, until out of memory (PR3082).
12 br i1 undef, label %exit.1, label %loopexit
15 br i1 undef, label %loopentry, label %exit.0
26 ; CHECK-LABEL: define {{[^@]+}}@test() {
28 ; CHECK-NEXT: br label [[CODEREPL:%.*]]
30 ; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @test.loopentry()
31 ; CHECK-NEXT: br i1 [[TARGETBLOCK]], label [[EXIT_1:%.*]], label [[EXIT_0:%.*]]
33 ; CHECK-NEXT: br label [[UNIFIED:%.*]]
35 ; CHECK-NEXT: br label [[UNIFIED]]
37 ; CHECK-NEXT: ret void
40 ; CHECK-LABEL: define {{[^@]+}}@test.loopentry() {
41 ; CHECK-NEXT: newFuncRoot:
42 ; CHECK-NEXT: br label [[LOOPENTRY:%.*]]
44 ; CHECK-NEXT: br i1 undef, label [[EXIT_1_EXITSTUB:%.*]], label [[LOOPEXIT:%.*]]
46 ; CHECK-NEXT: br i1 undef, label [[LOOPENTRY]], label [[EXIT_0_EXITSTUB:%.*]]
47 ; CHECK: exit.1.exitStub:
48 ; CHECK-NEXT: ret i1 true
49 ; CHECK: exit.0.exitStub:
50 ; CHECK-NEXT: ret i1 false