summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/discard-print-gc.s
blob: 2a230e53dc2bbdf678970ed440c209f5c98b5943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# REQUIRES: x86

# RUN: llvm-mc -triple x86_64-pc-linux %s -o %t.o -filetype=obj
# RUN: ld.lld -o %t.so --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
# RUN:   FileCheck -check-prefix=CHECK %s

# RUN: echo "SECTIONS { /DISCARD/ : { *(.foo) } }" > %t.script
# RUN: ld.lld -o %t.so -T %t.script %t.o --print-gc-sections -shared 2>&1 | \
# RUN:   FileCheck -check-prefix=QUIET --allow-empty %s

# RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t2.script
# RUN: ld.lld -o %t.so -T %t2.script --gc-sections %t.o --print-gc-sections -shared 2>&1 | \
# RUN:   FileCheck -check-prefix=CHECK %s

.section .foo,"a"
.quad 0

# CHECK: removing unused section from '.foo'
# QUIET-NOT: removing unused section from '.foo'