brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · e5e3047 Raw
35 lines · plain
1; RUN: opt -module-summary %s -o %t.o2; RUN: opt -module-summary %p/Inputs/thinlto_linkonceresolution.ll -o %t2.o3 4; Ensure the plugin ensures that for ThinLTO the prevailing copy of a5; linkonce symbol is changed to weak to ensure it is not eliminated.6; Note that gold picks the first copy of f() as the prevailing one,7; so listing %t2.o first is sufficient to ensure that this copy is8; preempted. Also, set the import-instr-limit to 0 to prevent f() from9; being imported from %t2.o which hides the problem.10; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \11; RUN:     --plugin-opt=thinlto \12; RUN:     --plugin-opt=-import-instr-limit=0 \13; RUN:     --plugin-opt=save-temps \14; RUN:     -shared \15; RUN:     -o %t3.o %t2.o %t.o16; RUN: llvm-nm %t3.o | FileCheck %s17; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck --check-prefix=OPT %s18; RUN: llvm-dis %t2.o.4.opt.bc -o - | FileCheck --check-prefix=OPT2 %s19 20; Ensure that f() is defined in resulting object file, and also21; confirm the weak linkage directly in the saved opt bitcode files.22; CHECK-NOT: U f23; OPT-NOT: @f()24; OPT2: define weak_odr hidden void @f()25 26target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"27target triple = "x86_64-unknown-linux-gnu"28define i32 @g() {29  call void @f()30  ret i32 031}32define linkonce_odr hidden void @f() {33  ret void34}35