Changeset View
Changeset View
Standalone View
Standalone View
lld/test/ELF/deplibs-lto.s
- This file was added.
# REQUIRES: aarch64 | |||||
# RUN: rm -rf %t.inputs %t.dir | |||||
# RUN: mkdir -p %t.inputs %t.dir | |||||
# RUN: split-file %s %t.inputs | |||||
# RUN: llvm-mc -filetype=obj -triple=aarch64 %t.inputs/deplibs.s -o %tdeplibs.o | |||||
# RUN: llvm-mc -filetype=obj -triple=aarch64 %t.inputs/foo.s -o %tfoo.o | |||||
# RUN: llvm-as %t.inputs/lto.ll -o %t.o | |||||
# RUN: llvm-ar rc %t.dir/libdeplibs.a %tdeplibs.o | |||||
# RUN: llvm-ar rc %t.dir/libfoo.a %tfoo.o | |||||
# LTO can emit libcalls that are resolved using libraries that contain .deplibs. | |||||
# Such libraries must be handled as if they were input files, and any referenced | |||||
# deplibs must be added to the link. Otherwise, symbols in the library may go | |||||
# undefined. | |||||
# RUN: ld.lld %t.o -u a -o /dev/null -L %t.dir -ldeplibs --trace 2>&1 | \ | |||||
# RUN: FileCheck %s -DOBJ=%t.o -DDIR=%t.dir --check-prefix=LIBA-DIR | |||||
# LIBA-DIR: [[OBJ]] | |||||
# LIBA-DIR-NEXT: [[DIR]]{{[\\/]}}libdeplibs.a | |||||
# LIBA-DIR-NEXT: [[DIR]]{{[\\/]}}libfoo.a | |||||
#--- foo.s | |||||
.global foo | |||||
foo: | |||||
#--- deplibs.s | |||||
.global __aarch64_ldadd4_relax | |||||
__aarch64_ldadd4_relax: | |||||
b foo | |||||
.section ".deplibs","MS",@llvm_dependent_libraries,1 | |||||
.asciz "foo" | |||||
#--- lto.ll | |||||
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" | |||||
target triple = "aarch64" | |||||
define void @a(i32* nocapture %0) #0 { | |||||
%2 = atomicrmw add i32* %0, i32 1 monotonic, align 4 | |||||
ret void | |||||
} | |||||
attributes #0 = { "target-features"="+outline-atomics" } |