1 ; RUN: opt -thinlto-bc %s -o %t1.bc
2 ; RUN: opt -thinlto-bc %p/Inputs/import-symver-foo.ll -o %t2.bc
3 ; RUN: llvm-lto -thinlto-action=thinlink %t1.bc %t2.bc -o %t3.index.bc
5 ; RUN: llvm-lto -thinlto-action=import -exported-symbol=main %t1.bc -thinlto-index=%t3.index.bc
6 ; RUN: llvm-dis %t1.bc.thinlto.imported.bc -o - | FileCheck --check-prefix=IMPORT %s
8 ; RUN: llvm-lto -thinlto-action=import -exported-symbol=main -import-instr-limit=0 %t1.bc -thinlto-index=%t3.index.bc
9 ; RUN: llvm-dis %t1.bc.thinlto.imported.bc -o - | FileCheck --check-prefix=NOIMPORT %s
11 ; When @bar gets imported, the symver must be imported too.
12 ; IMPORT: module asm ".symver bar, bar@BAR_1.2.3"
13 ; IMPORT: declare dso_local i32 @bar()
15 ; When @bar isn't imported, the symver is also not imported.
16 ; NOIMPORT-NOT: module asm
17 ; NOIMPORT-NOT: declare dso_local i32 @bar()
19 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
20 target triple = "x86_64-unknown-linux-gnu"
22 declare dso_local i32 @foo()
24 define dso_local i32 @main() {
26 %call = tail call i32 @foo()