2017-02-16 16:41:19 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2020-02-27 08:24:58 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
|
|
# RUN: ld.lld --gc-sections --print-gc-sections %t.o -o /dev/null | count 0
|
2017-02-16 16:41:19 +08:00
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
.quad .foo
|
|
|
|
|
2020-02-27 08:24:58 +08:00
|
|
|
## .foo is retained, so sections linking to it are retained as well.
|
2017-02-16 16:41:19 +08:00
|
|
|
.section .foo,"a"
|
|
|
|
.quad 0
|
2017-04-05 06:35:16 +08:00
|
|
|
.section .bar,"ao",@progbits,.foo
|
2017-02-16 16:41:19 +08:00
|
|
|
.quad 0
|
2017-04-05 06:35:16 +08:00
|
|
|
.section .zed,"ao",@progbits,.foo
|
2017-02-16 16:41:19 +08:00
|
|
|
.quad 0
|
2020-10-22 01:11:20 +08:00
|
|
|
|
|
|
|
.section .nonalloc
|
|
|
|
.quad 0
|
|
|
|
|
|
|
|
.section .nonalloc_linkorder,"o",@progbits,.nonalloc
|
|
|
|
.quad 0
|