[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / deplibs-lto.s
blobea8be56b1515a48b781047812738e577590634e6
1 # REQUIRES: aarch64
3 # RUN: rm -rf %t && split-file %s %t && cd %t
4 # RUN: llvm-mc -filetype=obj -triple=aarch64 -o deplibs.o deplibs.s
5 # RUN: llvm-mc -filetype=obj -triple=aarch64 -o foo.o foo.s
6 # RUN: llvm-as -o lto.o lto.ll
7 # RUN: llvm-ar rc libdeplibs.a deplibs.o
8 # RUN: llvm-ar rc libfoo.a foo.o
10 ## LTO emits a libcall (__aarch64_ldadd4_relax) that is resolved using a
11 ## library (libdeplibs.a) that contains a .deplibs section pointing to a file
12 ## (libfoo.a) not yet added to the link.
13 # RUN: not ld.lld lto.o -u a -L. -ldeplibs 2>&1 | FileCheck %s
14 # CHECK: error: input file 'foo.o' added after LTO
16 ## Including the file before LTO prevents the issue.
17 # RUN: ld.lld lto.o -u a -L. -ldeplibs -lfoo
19 #--- foo.s
20 .global foo
21 foo:
22 #--- deplibs.s
23 .global __aarch64_ldadd4_relax
24 __aarch64_ldadd4_relax:
25 b foo
26 .section ".deplibs","MS",@llvm_dependent_libraries,1
27 .asciz "foo"
28 #--- lto.ll
29 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
30 target triple = "aarch64"
32 define void @a(i32* nocapture %0) #0 {
33 %2 = atomicrmw add i32* %0, i32 1 monotonic, align 4
34 ret void
37 attributes #0 = { "target-features"="+outline-atomics" }