Skip to content

Commit f915fac

Browse files
committed
[JITLink][AArch32] Add test for ELF::R_ARM_THM_MOV{W_ABS_NC,T_ABS}
Support for ELF::R_ARM_THM_MOVW_ABS_NC and ELF::R_ARM_THM_MOVT_ABS was present but lacked tests. Test cases are similar to the ARM versions of the relocations in ELF_static_arm_reloc.s.
1 parent 066eea7 commit f915fac

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

llvm/test/ExecutionEngine/JITLink/AArch32/ELF_static_thumb_reloc.s

+35
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,41 @@ jump24_target:
6060
bx lr
6161
.size jump24_target, .-jump24_target
6262

63+
# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVW_ABS_NC data_symbol
64+
# CHECK-INSTR: 0000000c <movw>:
65+
# CHECK-INSTR: c: f240 0000 movw r0, #0x0
66+
# jitlink-check: decode_operand(movw, 1) = (data_symbol&0x0000ffff)
67+
.globl movw
68+
.type movw,%function
69+
.p2align 1
70+
.code 16
71+
.thumb_func
72+
movw:
73+
movw r0, :lower16:data_symbol
74+
.size movw, .-movw
75+
76+
# CHECK-TYPE: {{[0-9a-f]+}} R_ARM_THM_MOVT_ABS data_symbol
77+
# CHECK-INSTR: 00000010 <movt>:
78+
# CHECK-INSTR: 10: f2c0 0000 movt r0, #0x0
79+
# We decode the operand with index 2, because movt generates one leading implicit
80+
# predicate operand that we have to skip in order to decode the data_symbol operand
81+
# jitlink-check: decode_operand(movt, 2) = (data_symbol&0xffff0000>>16)
82+
.globl movt
83+
.type movt,%function
84+
.p2align 1
85+
.code 16
86+
.thumb_func
87+
movt:
88+
movt r0, :upper16:data_symbol
89+
.size movt, .-movt
90+
91+
.data
92+
.global data_symbol
93+
data_symbol:
94+
.long 1073741822
95+
96+
.text
97+
6398
# Empty main function for jitlink to be happy
6499
.globl main
65100
.type main,%function

0 commit comments

Comments
 (0)