Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
Analysis
Assembler
Bindings
Bitcode
BugPoint
CodeGen
DebugInfo
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LTO
Linker
MC
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO
Transforms
Unit
Verifier
YAMLParser
tools
dsymutil
gold
PowerPC
X86
Inputs
v1.12
alias.ll
alias2.ll
asm_undefined.ll
asm_undefined2.ll
available-externally.ll
bad-alias.ll
bcsection.ll
cache.ll
coff.ll
comdat.ll
comdat2.ll
common.ll
common_thinlto.ll
ctors.ll
ctors2.ll
disable-verify.ll
drop-debug.ll
drop-linkage.ll
emit-llvm.ll
error-unopenable.ll
global_with_section.ll
invalid.ll
irmover-error.ll
linker-script.ll
linkonce-weak.ll
lit.local.cfg
mixed_lto.ll
module_asm.ll
multiple-data.s
multiple-sections.ll
no-map-whole-file.ll
opt-level.ll
parallel.ll
pr19901.ll
pr19901_thinlto.ll
pr25907.ll
pr25915.ll
relax-relocs.ll
relocatable.ll
relocation-model-pic.ll
remarks.ll
resolve-to-alias.ll
slp-vectorize.ll
start-lib-common.ll
stats.ll
strip_names.ll
thinlto.ll
thinlto_afdo.ll
thinlto_alias.ll
thinlto_archive.ll
thinlto_emit_imports.ll
thinlto_emit_linked_objects.ll
thinlto_funcimport.ll
thinlto_internalize.ll
thinlto_linkonceresolution.ll
thinlto_object_suffix_replace.ll
thinlto_prefix_replace.ll
thinlto_weak_library.ll
thinlto_weak_resolution.ll
type-merge.ll
type-merge2.ll
unnamed-addr.ll
vectorize.ll
visibility.ll
weak.ll
invalid-dir.ll
lit.local.cfg
llvm-ar
llvm-cfi-verify
llvm-config
llvm-cov
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt
llvm-dlltool
llvm-dwarfdump
llvm-dwp
llvm-extract
llvm-isel-fuzzer
llvm-lib
llvm-lit
llvm-lto
llvm-lto2
llvm-mc
llvm-modextract
llvm-mt
llvm-nm
llvm-objcopy
llvm-objdump
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbdump
llvm-profdata
llvm-rc
llvm-readobj
llvm-size
llvm-split
llvm-strings
llvm-symbolizer
llvm-xray
lto
obj2yaml
opt-viewer
sancov
sanstats
yaml2obj
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
version.txt.in
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
linux-packaging-mono/external/llvm-project/llvm/test/tools/gold/X86/thinlto_linkonceresolution.ll

35 lines
1.3 KiB
LLVM
Raw Normal View History

; RUN: opt -module-summary %s -o %t.o
; RUN: opt -module-summary %p/Inputs/thinlto_linkonceresolution.ll -o %t2.o
; Ensure the plugin ensures that for ThinLTO the prevailing copy of a
; linkonce symbol is changed to weak to ensure it is not eliminated.
; Note that gold picks the first copy of f() as the prevailing one,
; so listing %t2.o first is sufficient to ensure that this copy is
; preempted. Also, set the import-instr-limit to 0 to prevent f() from
; being imported from %t2.o which hides the problem.
; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
; RUN: --plugin-opt=thinlto \
; RUN: --plugin-opt=-import-instr-limit=0 \
; RUN: --plugin-opt=save-temps \
; RUN: -shared \
; RUN: -o %t3.o %t2.o %t.o
; RUN: llvm-nm %t3.o | FileCheck %s
; RUN: llvm-dis %t.o.4.opt.bc -o - | FileCheck --check-prefix=OPT %s
; RUN: llvm-dis %t2.o.4.opt.bc -o - | FileCheck --check-prefix=OPT2 %s
; Ensure that f() is defined in resulting object file, and also
; confirm the weak linkage directly in the saved opt bitcode files.
; CHECK-NOT: U f
; OPT-NOT: @f()
; OPT2: define weak_odr dso_local hidden void @f()
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @g() {
call void @f()
ret i32 0
}
define linkonce_odr hidden void @f() {
ret void
}