• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -module-summary %s -o %t.o
2; RUN: opt -module-summary %p/Inputs/thinlto_alias.ll -o %t2.o
3
4; Ensure that a preempted weak symbol that is linked in as a local
5; copy is handled properly. Specifically, the local copy will be promoted,
6; and internalization should be able to use the original non-promoted
7; name to locate the summary (otherwise internalization will abort because
8; it expects to locate summaries for all definitions).
9; Note that gold picks the first copy of weakfunc() as the prevailing one,
10; so listing %t2.o first is sufficient to ensure that this copy is
11; preempted.
12; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
13; RUN:     --plugin-opt=thinlto \
14; RUN:     --plugin-opt=save-temps \
15; RUN:     -o %t3.o %t2.o %t.o
16; RUN: llvm-nm %t3.o | FileCheck %s
17; RUN: llvm-dis %t.o.opt.bc -o - | FileCheck --check-prefix=OPT %s
18; RUN: llvm-dis %t2.o.opt.bc -o - | FileCheck --check-prefix=OPT2 %s
19
20; CHECK-NOT: U f
21; OPT: define hidden void @weakfunc.llvm.0()
22; OPT2: define weak void @weakfunc()
23
24target triple = "x86_64-unknown-linux-gnu"
25
26@weakfuncAlias = alias void (...), bitcast (void ()* @weakfunc to void (...)*)
27define weak void @weakfunc() {
28entry:
29  ret void
30}
31