1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Transforms/CodeExtractor/LoopExtractor_infinite.ll
Arthur Eubanks 5f33c09feb [test][NewPM] Pin -mergereturn tests to legacy PM
Looks like this pass isn't really used and hasn't been worked on in a
loooong time.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D89010
2020-10-13 22:56:59 -07:00

48 lines
1.6 KiB
LLVM

; RUN: opt < %s -mergereturn -loop-extract -enable-new-pm=0 -S | FileCheck %s
; This test used to enter an infinite loop, until out of memory (PR3082).
define void @test() {
; CHECK-LABEL: define void @test()
; CHECK-NEXT: entry:
; CHECK-NEXT: br label %codeRepl
; CHECK: codeRepl:
; CHECK-NEXT: %targetBlock = call i1 @test.loopentry()
; CHECK-NEXT: br i1 %targetBlock, label %exit.1, label %exit.0
; CHECK: exit.0:
; CHECK-NEXT: br label %UnifiedReturnBlock
; CHECK: exit.1:
; CHECK-NEXT: br label %UnifiedReturnBlock
; CHECK: UnifiedReturnBlock:
; CHECK-NEXT: ret void
entry:
br label %loopentry
loopentry: ; preds = %loopexit, %entry
br i1 undef, label %exit.1, label %loopexit
loopexit: ; preds = %loopentry
br i1 undef, label %loopentry, label %exit.0
exit.0: ; preds = %loopexit
ret void
exit.1: ; preds = %loopentry
ret void
}
; CHECK-LABEL: define internal i1 @test.loopentry()
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label %loopentry
; CHECK: exit.1.exitStub:
; CHECK-NEXT: ret i1 true
; CHECK: exit.0.exitStub:
; CHECK-NEXT: ret i1 false
; CHECK: loopentry:
; CHECK-NEXT: br i1 true, label %exit.1.exitStub, label %loopexit
; CHECK: loopexit:
; CHECK-NEXT: br i1 false, label %loopexit.loopentry_crit_edge, label %exit.0.exitStub
; CHECK: loopexit.loopentry_crit_edge:
; CHECK-NEXT: br label %loopentry