[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / trace-ar.s
blob0a71f7eba9f4b635e9a399cca08c73377d8060ca
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.foo.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/trace-ar1.s -o %t.obj1.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/trace-ar2.s -o %t.obj2.o
5 # RUN: rm -f %t.boo.a
6 # RUN: llvm-ar rcs %t.boo.a %t.obj1.o %t.obj2.o
8 ## Check how -t works with achieves
9 # RUN: ld.lld %t.foo.o %t.boo.a -o %t.out -t 2>&1 | FileCheck %s
10 # CHECK: {{.*}}.foo.o
11 # CHECK-NEXT: {{.*}}.boo.a({{.*}}.obj1.o)
12 # CHECK-NOT: {{.*}}.boo.a({{.*}}.obj2.o)
14 ## Test output with --start-lib
15 # RUN: ld.lld %t.foo.o --start-lib %t.obj1.o %t.obj2.o -o %t.out -t 2>&1 | FileCheck --check-prefix=STARTLIB %s
16 # STARTLIB: {{.*}}.foo.o
17 # STARTLIB-NEXT: {{.*}}.obj1.o
18 # STARTLIB-NOT: {{.*}}.obj2.o
20 .globl _start, _used
21 _start:
22 call _used