Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / gc-sections-tls.s
blob3036a676dde1235662ebd43c1af4010b3d7f2a4c
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 ## When a TLS section is discarded, we will resolve the relocation in a non-SHF_ALLOC
5 ## section to the addend. Technically, we can emit an error in this case as the
6 ## relocation type is not TLS.
7 # RUN: ld.lld %t.o --gc-sections -o %t
8 # RUN: llvm-readelf -x .noalloc %t | FileCheck %s
10 # RUN: echo '.section .tbss,"awT"; .globl root; root: .long 0' | \
11 # RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
12 # RUN: ld.lld --gc-sections -u root %t.o %t1.o -o %t
13 # RUN: llvm-readelf -x .noalloc %t | FileCheck %s
15 # CHECK: Hex dump of section '.noalloc':
16 # CHECK-NEXT: 0x00000000 00800000 00000000
18 .globl _start
19 _start:
21 .section .tbss,"awT",@nobits
22 .long 0
23 tls:
24 .long 0
26 .section .noalloc,""
27 .quad tls+0x8000