summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/RISCV/relocations.s
diff options
context:
space:
mode:
authorLewis Revill <lewis.revill@embecosm.com>2019-04-23 14:46:13 +0000
committerLewis Revill <lewis.revill@embecosm.com>2019-04-23 14:46:13 +0000
commitdf3cb477a314a3c3abbbfbbfa2e88245bcfa325f (patch)
tree00e1c3f3f730e4bbd7647e1c00f4c0bab3228197 /llvm/test/MC/RISCV/relocations.s
parent9fc422830a9003eaf9d649e07486e4d985d68a8f (diff)
downloadbcm5719-llvm-df3cb477a314a3c3abbbfbbfa2e88245bcfa325f.tar.gz
bcm5719-llvm-df3cb477a314a3c3abbbfbbfa2e88245bcfa325f.zip
[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers
This patch adds support for parsing and assembling the %tls_ie_pcrel_hi and %tls_gd_pcrel_hi modifiers. Differential Revision: https://reviews.llvm.org/D55342 llvm-svn: 358994
Diffstat (limited to 'llvm/test/MC/RISCV/relocations.s')
-rw-r--r--llvm/test/MC/RISCV/relocations.s32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/MC/RISCV/relocations.s b/llvm/test/MC/RISCV/relocations.s
index 44a5d08f81e..10a28903906 100644
--- a/llvm/test/MC/RISCV/relocations.s
+++ b/llvm/test/MC/RISCV/relocations.s
@@ -129,6 +129,38 @@ sb t1, %pcrel_lo(.L2)(a2)
# INSTR: sb t1, %pcrel_lo(.L2)(a2)
# FIXUP: fixup A - offset: 0, value: %pcrel_lo(.L2), kind: fixup_riscv_pcrel_lo12_s
+.L3:
+auipc t1, %tls_ie_pcrel_hi(foo)
+# RELOC: R_RISCV_TLS_GOT_HI20 foo 0x0
+# INSTR: auipc t1, %tls_ie_pcrel_hi(foo)
+# FIXUP: fixup A - offset: 0, value: %tls_ie_pcrel_hi(foo), kind: fixup_riscv_tls_got_hi20
+
+addi t1, t1, %pcrel_lo(.L3)
+# RELOC: R_RISCV_PCREL_LO12_I .L3 0x0
+# INSTR: addi t1, t1, %pcrel_lo(.L3)
+# FIXUP: fixup A - offset: 0, value: %pcrel_lo(.L3), kind: fixup_riscv_pcrel_lo12_i
+
+sb t1, %pcrel_lo(.L3)(a2)
+# RELOC: R_RISCV_PCREL_LO12_S .L3 0x0
+# INSTR: sb t1, %pcrel_lo(.L3)(a2)
+# FIXUP: fixup A - offset: 0, value: %pcrel_lo(.L3), kind: fixup_riscv_pcrel_lo12_s
+
+.L4:
+auipc t1, %tls_gd_pcrel_hi(foo)
+# RELOC: R_RISCV_TLS_GD_HI20 foo 0x0
+# INSTR: auipc t1, %tls_gd_pcrel_hi(foo)
+# FIXUP: fixup A - offset: 0, value: %tls_gd_pcrel_hi(foo), kind: fixup_riscv_tls_gd_hi20
+
+addi t1, t1, %pcrel_lo(.L4)
+# RELOC: R_RISCV_PCREL_LO12_I .L4 0x0
+# INSTR: addi t1, t1, %pcrel_lo(.L4)
+# FIXUP: fixup A - offset: 0, value: %pcrel_lo(.L4), kind: fixup_riscv_pcrel_lo12_i
+
+sb t1, %pcrel_lo(.L4)(a2)
+# RELOC: R_RISCV_PCREL_LO12_S .L4 0x0
+# INSTR: sb t1, %pcrel_lo(.L4)(a2)
+# FIXUP: fixup A - offset: 0, value: %pcrel_lo(.L4), kind: fixup_riscv_pcrel_lo12_s
+
add t1, t1, tp, %tprel_add(foo)
# RELOC: R_RISCV_TPREL_ADD foo 0x0
# INSTR: add t1, t1, tp, %tprel_add(foo)
OpenPOWER on IntegriCloud