1 ; RUN: opt -passes=inline -S < %s | FileCheck %s
2 ; RUN: opt -passes='cgscc(inline)' -S < %s | FileCheck %s
3 ; RUN: opt -passes='module-inline' -S < %s | FileCheck %s
5 ; PR23216: We can't inline functions using llvm.localescape.
7 declare void @llvm.localescape(...)
8 declare ptr @llvm.frameaddress(i32)
9 declare ptr @llvm.localrecover(ptr, ptr, i32)
11 define internal void @foo(ptr %fp) {
12 %a.i8 = call ptr @llvm.localrecover(ptr @bar, ptr %fp, i32 0)
13 store i32 42, ptr %a.i8
17 define internal i32 @bar() {
20 call void (...) @llvm.localescape(ptr %a)
21 %fp = call ptr @llvm.frameaddress(i32 0)
22 tail call void @foo(ptr %fp)
27 ; We even bail when someone marks it alwaysinline.
28 define internal i32 @bar_alwaysinline() alwaysinline {
31 call void (...) @llvm.localescape(ptr %a)
32 tail call void @foo(ptr null)
38 %r = tail call i32 @bar()
39 %r1 = tail call i32 @bar_alwaysinline()
43 ; CHECK: define i32 @bazz()
44 ; CHECK: call i32 @bar()
45 ; CHECK: call i32 @bar_alwaysinline()