[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / partition-icf.s
blobe8608c899fc19b6d407071ea4881ea96f9472d8d
1 // REQUIRES: x86
2 // RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux
3 // RUN: ld.lld %t.o -o %t --export-dynamic --gc-sections --icf=all
4 // RUN: llvm-readelf -S -s %t | FileCheck %s
6 // CHECK: part1
7 // CHECK: [[P1:[0-9]+]]] .text
8 // CHECK: part2
9 // CHECK: [[P2:[0-9]+]]] .text
11 // CHECK: Symbol table '.symtab'
12 // CHECK: [[P1]] f1
13 // CHECK: [[P2]] f2
14 // CHECK: [[P1]] g1
15 // CHECK: [[P2]] g2
17 .section .llvm_sympart.f1,"",@llvm_sympart
18 .asciz "part1"
19 .quad f1
21 .section .llvm_sympart.f2,"",@llvm_sympart
22 .asciz "part2"
23 .quad f2
25 .section .llvm_sympart.g1,"",@llvm_sympart
26 .asciz "part1"
27 .quad g1
29 .section .llvm_sympart.g2,"",@llvm_sympart
30 .asciz "part2"
31 .quad g2
33 .section .text.f1,"ax",@progbits
34 .globl f1
35 f1:
36 .byte 1
38 .section .text.f2,"ax",@progbits
39 .globl f2
40 f2:
41 .byte 2
43 .section .text.g1,"ax",@progbits
44 .globl g1
45 g1:
46 .byte 3
48 .section .text.g2,"ax",@progbits
49 .globl g2
50 g2:
51 .byte 3