Skip to content

Commit d4e2e28

Browse files
committed
[ELF][test] Add test coverage of TLS to gc-sections.s
Differential Revision: https://reviews.llvm.org/D86639
1 parent b6cca0e commit d4e2e28

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

lld/test/ELF/gc-sections.s

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212
# NOGC: Name: .text
1313
# NOGC: Name: .init
1414
# NOGC: Name: .fini
15+
# NOGC: Name: .tdata
16+
# NOGC: Name: .tbss
1517
# NOGC: Name: .ctors
1618
# NOGC: Name: .dtors
1719
# NOGC: Name: .debug_pubtypes
1820
# NOGC: Name: .comment
1921
# NOGC: Name: a
2022
# NOGC: Name: b
2123
# NOGC: Name: c
24+
# NOGC: Name: e
25+
# NOGC: Name: f
26+
# NOGC: Name: g
27+
# NOGC: Name: h
2228
# NOGC: Name: x
2329
# NOGC: Name: y
2430
# NOGC: Name: d
@@ -27,13 +33,19 @@
2733
# GC1: Name: .text
2834
# GC1: Name: .init
2935
# GC1: Name: .fini
36+
# GC1: Name: .tdata
37+
# GC1: Name: .tbss
3038
# GC1: Name: .ctors
3139
# GC1: Name: .dtors
3240
# GC1: Name: .debug_pubtypes
3341
# GC1: Name: .comment
3442
# GC1: Name: a
3543
# GC1: Name: b
3644
# GC1: Name: c
45+
# GC1: Name: e
46+
# GC1-NOT: Name: f
47+
# GC1: Name: g
48+
# GC1-NOT: Name: h
3749
# GC1-NOT: Name: x
3850
# GC1-NOT: Name: y
3951
# GC1-NOT: Name: d
@@ -42,19 +54,25 @@
4254
# GC2: Name: .text
4355
# GC2: Name: .init
4456
# GC2: Name: .fini
57+
# GC2: Name: .tdata
58+
# GC2: Name: .tbss
4559
# GC2: Name: .ctors
4660
# GC2: Name: .dtors
4761
# GC2: Name: .debug_pubtypes
4862
# GC2: Name: .comment
4963
# GC2: Name: a
5064
# GC2: Name: b
5165
# GC2: Name: c
66+
# GC2: Name: e
67+
# GC2-NOT: Name: f
68+
# GC2: Name: g
69+
# GC2-NOT: Name: h
5270
# GC2-NOT: Name: x
5371
# GC2-NOT: Name: y
5472
# GC2: Name: d
5573

5674
.globl _start, d
57-
.protected a, b, c, x, y
75+
.protected a, b, c, e, f, g, h, x, y
5876
_start:
5977
call a
6078

@@ -65,11 +83,12 @@ a:
6583

6684
.section .text.b,"ax",@progbits
6785
b:
86+
leaq e@tpoff(%rax),%rdx
6887
call c
6988

7089
.section .text.c,"ax",@progbits
7190
c:
72-
nop
91+
leaq g@tpoff(%rax),%rdx
7392

7493
.section .text.d,"ax",@progbits
7594
d:
@@ -83,6 +102,22 @@ x:
83102
y:
84103
call x
85104

105+
.section .tbss.e,"awT",@nobits
106+
e:
107+
.quad 0
108+
109+
.section .tbss.f,"awT",@nobits
110+
f:
111+
.quad 0
112+
113+
.section .tdata.g,"awT",@progbits
114+
g:
115+
.quad 0
116+
117+
.section .tdata.h,"awT",@progbits
118+
h:
119+
.quad 0
120+
86121
.section .ctors,"aw",@progbits
87122
.quad 0
88123

0 commit comments

Comments
 (0)