[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / symbolreferenced.s
blobf6d9a1214fdd9d4155db062435bab23ab5487c8c
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
4 # Provide new symbol. The value should be 1, like set in PROVIDE()
5 # RUN: echo "SECTIONS { PROVIDE(newsym = 1);}" > %t.script
6 # RUN: ld.lld -o %t1 --script %t.script %t
7 # RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE1 %s
8 # PROVIDE1: 0000000000000001 g *ABS* 0000000000000000 newsym
10 # Provide new symbol (hidden). The value should be 1
11 # RUN: echo "SECTIONS { PROVIDE_HIDDEN(newsym = 1);}" > %t.script
12 # RUN: ld.lld -o %t1 --script %t.script %t
13 # RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN1 %s
14 # HIDDEN1: 0000000000000001 l *ABS* 0000000000000000 .hidden newsym
16 # RUN: echo 'SECTIONS { PROVIDE_HIDDEN("newsym" = 1);}' > %t.script
17 # RUN: ld.lld -o %t1 --script %t.script %t
18 # RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN1 %s
20 .global _start
21 _start:
22 nop
24 .globl patatino
25 patatino:
26 movl newsym, %eax