1; This test makes sure a static var is not selected as a callee target
2; (which will crash compilation).
3; RUN: opt -module-summary %s -o %t.bc
4; RUN: opt -module-summary %p/Inputs/funcimport_var2.ll -o %t2.bc
5; RUN: llvm-lto -thinlto -thinlto-action=thinlink -o %t3 %t.bc %t2.bc
6; RUN: llvm-lto -thinlto -thinlto-action=import -thinlto-index=%t3 %t.bc %t2.bc
7; RUN: llvm-lto -thinlto -thinlto-action=run %t.bc %t2.bc -exported-symbol=_Z4LinkPKcS0_
8; RUN: llvm-nm %t.bc.thinlto.o | FileCheck %s
9; RUN: llvm-lto2 run %t.bc %t2.bc -o %t.out \
10; RUN:   -r %t.bc,_Z4LinkPKcS0_,plx \
11; RUN:   -r %t.bc,link,l \
12; RUN:   -r %t2.bc,get_link,plx
13; RUN: llvm-nm %t.out.1 | FileCheck %s
14; CHECK: U link
15
16; REQUIRES: x86-registered-target
17
18target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
19target triple = "x86_64-unknown-linux-gnu"
20
21define i32 @_Z4LinkPKcS0_(i8*, i8*) local_unnamed_addr  {
22  %3 = tail call i32 @link(i8* %0, i8* %1) #2
23  ret i32 %3
24}
25
26; Function Attrs: nounwind
27declare i32 @link(i8*, i8*) local_unnamed_addr
28