1; This test checks that ThinLTO doesn't try to import noinline function
2; which, when takes place, causes promotion of its callee.
3; RUN: opt -module-summary %s -o %t1.bc
4; RUN: opt -module-summary %p/Inputs/noinline.ll -o %t2.bc
5; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t3.o \
6; RUN:   -save-temps       \
7; RUN:   -r=%t1.bc,main,px \
8; RUN:   -r=%t1.bc,foo,    \
9; RUN:   -r=%t2.bc,foo,p
10
11; RUN: llvm-dis %t3.o.1.3.import.bc -o - | FileCheck %s
12
13; CHECK-NOT: define available_externally i32 @foo
14
15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
16target triple = "x86_64-pc-linux-gnu"
17
18; Function Attrs: nounwind ssp uwtable
19define i32 @main(i32, i8** nocapture readnone) local_unnamed_addr #0 {
20  %3 = tail call i32 @foo(i32 %0) #0
21  ret i32 %3
22}
23
24declare i32 @foo(i32) local_unnamed_addr
25
26attributes #0 = { nounwind }
27