LoopExtractor_crash.ll
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; RUN: opt < %s -inline -loop-extract -S | FileCheck %s
; RUN: opt < %s -argpromotion -loop-extract -S | FileCheck %s
; This test used to trigger an assert (PR8929).
define void @test() {
; CHECK-LABEL: define void @test()
; CHECK-NEXT: entry:
; CHECK-NEXT: br label %codeRepl
; CHECK: codeRepl:
; CHECK-NEXT: call void @test.loopentry()
; CHECK-NEXT: br label %loopexit
; CHECK: loopexit:
; CHECK-NEXT: br label %exit
; CHECK: exit:
; CHECK-NEXT: ret void
entry:
br label %loopentry
loopentry: ; preds = %loopbody, %entry
br i1 undef, label %loopbody, label %loopexit
loopbody: ; preds = %codeRepl1
call void @foo()
br label %loopentry
loopexit: ; preds = %codeRepl
br label %exit
exit: ; preds = %loopexit
ret void
}
declare void @foo()
; CHECK-LABEL: define internal void @test.loopentry()
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label %loopentry
; CHECK: loopexit.exitStub:
; CHECK-NEXT: ret void
; CHECK: loopentry:
; CHECK-NEXT: br i1 false, label %loopbody, label %loopexit.exitStub
; CHECK: loopbody:
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label %loopentry