[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / discard-print-gc.s
blobc9233ce7b0eb1e9cdcd13bc0366edf92547157fd
1 # REQUIRES: x86
3 # RUN: llvm-mc -triple x86_64-pc-linux %s -o %t.o -filetype=obj
4 # RUN: ld.lld -o %t.so --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
5 # RUN: FileCheck -check-prefix=CHECK %s
7 # RUN: echo "SECTIONS { /DISCARD/ : { *(.foo) } }" > %t.script
8 # RUN: ld.lld -o %t.so -T %t.script %t.o --print-gc-sections -shared 2>&1 | \
9 # RUN: FileCheck -check-prefix=QUIET --allow-empty %s
11 # RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t2.script
12 # RUN: ld.lld -o %t.so -T %t2.script --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
13 # RUN: FileCheck -check-prefix=CHECK %s
15 .section .foo,"a"
16 .quad 0
18 # CHECK: removing unused section {{.*}}:(.foo)
19 # QUIET-NOT: removing unused section {{.*}}:(.foo)