2016-12-27 10:47:37 +08:00
|
|
|
; RUN: opt < %s -inline -S | FileCheck %s
|
2016-12-27 15:18:43 +08:00
|
|
|
; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
|
2007-12-20 05:13:37 +08:00
|
|
|
|
|
|
|
declare i1 @extern()
|
|
|
|
|
|
|
|
define internal i32 @test() {
|
2016-12-27 10:47:37 +08:00
|
|
|
; CHECK-NOT: define .* @test()
|
2007-12-20 05:13:37 +08:00
|
|
|
entry:
|
2016-12-27 10:47:37 +08:00
|
|
|
%n = call i1 @extern()
|
|
|
|
br i1 %n, label %r, label %u
|
|
|
|
|
2007-12-20 05:13:37 +08:00
|
|
|
r:
|
2016-12-27 10:47:37 +08:00
|
|
|
ret i32 0
|
|
|
|
|
2007-12-20 05:13:37 +08:00
|
|
|
u:
|
2016-12-27 10:47:37 +08:00
|
|
|
unreachable
|
2007-12-20 05:13:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @caller() {
|
2016-12-27 10:47:37 +08:00
|
|
|
; CHECK-LABEL: define i32 @caller()
|
|
|
|
entry:
|
|
|
|
%X = call i32 @test() nounwind
|
|
|
|
; CHECK-NOT: call i32 @test()
|
|
|
|
; CHECK: call i1 @extern() #0
|
|
|
|
; CHECK: br i1 %{{.*}}, label %[[R:.*]], label %[[U:.*]]
|
|
|
|
|
|
|
|
; CHECK: [[U]]:
|
|
|
|
; CHECK: unreachable
|
|
|
|
|
|
|
|
; CHECK: [[R]]:
|
|
|
|
ret i32 %X
|
|
|
|
; CHECK: ret i32 0
|
2007-12-20 05:13:37 +08:00
|
|
|
}
|
2016-12-27 10:47:37 +08:00
|
|
|
|
|
|
|
; CHECK: attributes #0 = { nounwind }
|