brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ea8be56 Raw
38 lines · plain
1# REQUIRES: aarch642 3# RUN: rm -rf %t && split-file %s %t && cd %t4# RUN: llvm-mc -filetype=obj -triple=aarch64 -o deplibs.o deplibs.s5# RUN: llvm-mc -filetype=obj -triple=aarch64 -o foo.o foo.s6# RUN: llvm-as -o lto.o lto.ll7# RUN: llvm-ar rc libdeplibs.a deplibs.o8# RUN: llvm-ar rc libfoo.a foo.o9 10## LTO emits a libcall (__aarch64_ldadd4_relax) that is resolved using a11## library (libdeplibs.a) that contains a .deplibs section pointing to a file12## (libfoo.a) not yet added to the link.13# RUN: not ld.lld lto.o -u a -L. -ldeplibs 2>&1 | FileCheck %s14# CHECK: error: input file 'foo.o' added after LTO15 16## Including the file before LTO prevents the issue.17# RUN: ld.lld lto.o -u a -L. -ldeplibs -lfoo18 19#--- foo.s20.global foo21foo:22#--- deplibs.s23.global __aarch64_ldadd4_relax24__aarch64_ldadd4_relax:25    b foo26.section ".deplibs","MS",@llvm_dependent_libraries,127    .asciz "foo"28#--- lto.ll29target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"30target triple = "aarch64"31 32define void @a(i32* nocapture %0) #0 {33  %2 = atomicrmw add i32* %0, i32 1 monotonic, align 434  ret void35}36 37attributes #0 = { "target-features"="+outline-atomics" }38