1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple thumbv7-windows-itanium -filetype obj -o %t/COFF_Thumb.o %s
3 # RUN: llvm-rtdyld -triple thumbv7-windows \
4 # RUN: -dummy-extern ExitProcess=0x54769891 \
5 # RUN: -dummy-extern unnamed_addr=0x00001024 -verify -check %s %t/COFF_Thumb.o
26 # b unnamed_addr @ IMAGE_REL_ARM_BRANCH24T
39 rel3
: @ IMAGE_REL_ARM_MOV32T
40 movw
r0, :lower16
:string
41 # rtdyld-check: decode_operand(rel3, 1) = (string&0x0000ffff)
42 movt
r0, :upper16
:string
43 # TODO rtdyld-check: decode_operand(rel3, 1) = (string&0xffff0000>>16)
45 load_from_dllimport_lo
: @ IMAGE_REL_ARM_MOV32T
46 movw
r0, :lower16
:__imp_ExitProcess
47 # (1) Check stub content.
48 # rtdyld-check: *{4}(stub_addr(COFF_Thumb.o/.text, __imp_ExitProcess)) = \
49 # rtdyld-check: ExitProcess
51 # (2) Check lo bits of stub address.
52 # rtdyld-check: decode_operand(load_from_dllimport_lo, 1) = \
53 # rtdyld-check: stub_addr(COFF_Thumb.o/.text, __imp_ExitProcess)[15:0]
54 load_from_dllimport_hi
:
55 movt
r0, :upper16
:__imp_ExitProcess
56 # (3) Check hi bits of stub address.
57 # rtdyld-check: decode_operand(load_from_dllimport_hi, 2) = \
58 # rtdyld-check: stub_addr(COFF_Thumb.o/.text, __imp_ExitProcess)[31:16]
76 # bl function @ IMAGE_REL_ARM_BLX23T
83 .asciz "Hello World\n"
90 .long function(imgrel) @ IMAGE_REL_ARM_ADDR32NB
91 # rtdyld-check: *{4}relocations = function - section_addr(COFF_Thumb.o, .text)
93 .secidx __imp_ExitProcess @ IMAGE_REL_ARM_SECTION
94 # rtdyld-check: *{2}rel9 = 2
96 .long relocations(secrel32) @ IMAGE_REL_ARM_SECREL
97 # rtdyld-check: *{4}rel10 = relocations - section_addr(COFF_Thumb.o, .data)
99 .secrel32 relocations @ IMAGE_REL_ARM_SECREL
100 # rtdyld-check: *{4}rel11 = relocations - section_addr(COFF_Thumb.o, .data)
108 branch_to_thumb_func
:
109 @ rel14
: @ IMAGE_REL_ARM_MOV32T
110 movw
r0, :lower16
:function
111 # rtdyld-check: decode_operand(branch_to_thumb_func, 1) = (function&0x0000ffff|1)
112 movt
r0, :upper16
:function
113 # TODO rtdyld-check: decode_operand(branch_to_thumb_func, 1) = (function&0xffff0000>>16)
127 ref_to_data_symbol_addr
:
128 @ rel15
: @ IMAGE_REL_ARM_MOV32T
129 movw
r0, :lower16
:a_data_symbol
130 # rtdyld-check: decode_operand(ref_to_data_symbol_addr, 1) = (a_data_symbol&0x0000ffff)
131 movt
r0, :upper16
:a_data_symbol
132 # TODO rtdyld-check: decode_operand(ref_to_data_symbol_addr, 1) = (a_data_symbol&0xffff0000>>16)