Skip to content

Commit 58154ca

Browse files
committed
Apply feedback on tests
1 parent 995cc68 commit 58154ca

File tree

2 files changed

+56
-211
lines changed

2 files changed

+56
-211
lines changed

llvm/test/MC/Sparc/Relocations/relocation-specifier-v9.s

Lines changed: 0 additions & 211 deletions
This file was deleted.

llvm/test/MC/Sparc/Relocations/relocation-specifier.s

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# RUN: llvm-mc %s -triple=sparc | FileCheck %s --check-prefix=ASM
2+
# RUN: llvm-mc %s --defsym V9=1 -triple=sparcv9 | FileCheck %s --check-prefixes=ASM,ASM-V9
23

34
# RUN: llvm-mc %s -triple=sparc -filetype=obj -o %t
45
# RUN: llvm-objdump -dr %t | FileCheck %s --check-prefix=OBJDUMP
56
# RUN: llvm-readelf -s - < %t | FileCheck %s --check-prefix=READELF --implicit-check-not=TLS
7+
# RUN: llvm-mc %s --defsym V9=1 -triple=sparcv9 -filetype=obj -o %t
8+
# RUN: llvm-objdump -dr %t | FileCheck %s --check-prefixes=OBJDUMP,OBJDUMP-V9
9+
# RUN: llvm-readelf -s - < %t | FileCheck %s --check-prefixes=READELF,READELF-V9 --implicit-check-not=TLS
610

711
# READELF: TLS LOCAL DEFAULT [[#]] s_tle_hix22
812
# READELF: TLS LOCAL DEFAULT [[#]] s_tldo_hix22
913
# READELF: TLS GLOBAL DEFAULT UND s_tle_lox10
14+
# READELF-V9: TLS GLOBAL DEFAULT UND s_tie_hi22
15+
# READELF-V9: TLS GLOBAL DEFAULT UND s_tie_lo10
16+
# READELF-V9: TLS GLOBAL DEFAULT UND s_tie_ld
17+
# READELF-V9: TLS GLOBAL DEFAULT UND s_tie_ldx
18+
# READELF-V9: TLS GLOBAL DEFAULT UND s_tie_add
1019
# READELF: TLS GLOBAL DEFAULT UND s_tldm_hi22
1120
# READELF: TLS GLOBAL DEFAULT UND s_tldm_lo10
1221
# READELF: TLS GLOBAL DEFAULT UND s_tldm_add
@@ -64,6 +73,33 @@ or %g1, %hm(sym), %g3
6473
or %g1, %ulo(sym), %g3
6574
sethi %lm(sym), %l0
6675

76+
.ifdef V9
77+
# ASM-V9: sethi %hix(sym), %g1
78+
# ASM-V9-NEXT: xor %g1, %lox(sym), %g1
79+
# ASM-V9-NEXT: sethi %gdop_hix22(sym), %l1
80+
# ASM-V9-NEXT: or %l1, %gdop_lox10(sym), %l1
81+
# ASM-V9-NEXT: ldx [%l7+%l1], %l2, %gdop(sym)
82+
# OBJDUMP-V9: sethi 0x3fffff, %g0
83+
# OBJDUMP-V9-NEXT: xor %g0, -0x400, %g0
84+
# OBJDUMP-V9-NEXT: sethi 0x0, %g1
85+
# OBJDUMP-V9-NEXT: R_SPARC_HIX22 sym
86+
# OBJDUMP-V9-NEXT: xor %g1, 0x0, %g1
87+
# OBJDUMP-V9-NEXT: R_SPARC_LOX10 sym
88+
# OBJDUMP-V9-NEXT: sethi 0x0, %l1
89+
# OBJDUMP-V9-NEXT: R_SPARC_GOTDATA_OP_HIX22 sym
90+
# OBJDUMP-V9-NEXT: or %l1, 0x0, %l1
91+
# OBJDUMP-V9-NEXT: R_SPARC_GOTDATA_OP_LOX10 sym
92+
# OBJDUMP-V9-NEXT: ldx [%l7+%l1], %l2
93+
# OBJDUMP-V9-NEXT: R_SPARC_GOTDATA_OP sym
94+
sethi %hix(zero), %g0
95+
xor %g0, %lox(zero), %g0
96+
sethi %hix(sym), %g1
97+
xor %g1, %lox(sym), %g1
98+
sethi %gdop_hix22(sym), %l1
99+
or %l1, %gdop_lox10(sym), %l1
100+
ldx [%l7 + %l1], %l2, %gdop(sym)
101+
.endif
102+
67103
.set abs, 0xfedcba98
68104
.set abs48, 0xfedcba987654
69105
zero = 0
@@ -114,6 +150,26 @@ xor %o0, %lox(abs), %o0
114150
sethi %tle_hix22(s_tle_hix22), %i0
115151
xor %i0, %tle_lox10(s_tle_lox10), %i0
116152

153+
.ifdef V9
154+
## Initial Executable model
155+
# ASM-V9: sethi %tie_hi22(s_tie_hi22), %i1
156+
# ASM-V9-NEXT: add %i1, %tie_lo10(s_tie_lo10), %i1
157+
# ASM-V9-NEXT: ld [%i0+%i1], %i0, %tie_ld(s_tie_ld)
158+
# ASM-V9-NEXT: ldx [%i0+%i1], %i0, %tie_ldx(s_tie_ldx)
159+
# ASM-V9-NEXT: add %g7, %i0, %o0, %tie_add(s_tie_add)
160+
161+
# OBJDUMP-V9: R_SPARC_TLS_IE_HI22 s_tie_hi22
162+
# OBJDUMP-V9: R_SPARC_TLS_IE_LO10 s_tie_lo10
163+
# OBJDUMP-V9: R_SPARC_TLS_IE_LD s_tie_ld
164+
# OBJDUMP-V9: R_SPARC_TLS_IE_LDX s_tie_ldx
165+
# OBJDUMP-V9: R_SPARC_TLS_IE_ADD s_tie_add
166+
sethi %tie_hi22(s_tie_hi22), %i1
167+
add %i1, %tie_lo10(s_tie_lo10), %i1
168+
ld [%i0+%i1], %i0, %tie_ld(s_tie_ld)
169+
ldx [%i0+%i1], %i0, %tie_ldx(s_tie_ldx)
170+
add %g7, %i0, %o0, %tie_add(s_tie_add)
171+
.endif
172+
117173
## Local Dynamic model
118174
# ASM: sethi %tldo_hix22(s_tldo_hix22), %i1
119175
# ASM-NEXT: sethi %tldm_hi22(s_tldm_hi22), %i2

0 commit comments

Comments
 (0)