1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test/Transforms/Inline/frameescape.ll
Chandler Carruth 3a1d9fe91a [PM] Turn on the new PM's inliner in addition to the current one for
most of the inliner test cases.

The inliner involves a bunch of interesting code and tends to be where
most of the issues I've seen experimenting with the new PM lie. All of
these test cases pass, but I'd like to keep some more thorough coverage
here so doing a fairly blanket enabling.

There are a handful of interesting tests I've not enabled yet because
they're focused on the always inliner, or on functionality that doesn't
(yet) exist in the inliner.

llvm-svn: 290592
2016-12-27 07:18:43 +00:00

46 lines
1.1 KiB
LLVM

; RUN: opt -inline -S < %s | FileCheck %s
; RUN: opt -passes='cgscc(inline)' -S < %s | FileCheck %s
; PR23216: We can't inline functions using llvm.localescape.
declare void @llvm.localescape(...)
declare i8* @llvm.frameaddress(i32)
declare i8* @llvm.localrecover(i8*, i8*, i32)
define internal void @foo(i8* %fp) {
%a.i8 = call i8* @llvm.localrecover(i8* bitcast (i32 ()* @bar to i8*), i8* %fp, i32 0)
%a = bitcast i8* %a.i8 to i32*
store i32 42, i32* %a
ret void
}
define internal i32 @bar() {
entry:
%a = alloca i32
call void (...) @llvm.localescape(i32* %a)
%fp = call i8* @llvm.frameaddress(i32 0)
tail call void @foo(i8* %fp)
%r = load i32, i32* %a
ret i32 %r
}
; We even bail when someone marks it alwaysinline.
define internal i32 @bar_alwaysinline() alwaysinline {
entry:
%a = alloca i32
call void (...) @llvm.localescape(i32* %a)
tail call void @foo(i8* null)
ret i32 0
}
define i32 @bazz() {
entry:
%r = tail call i32 @bar()
%r1 = tail call i32 @bar_alwaysinline()
ret i32 %r
}
; CHECK: define i32 @bazz()
; CHECK: call i32 @bar()
; CHECK: call i32 @bar_alwaysinline()