1 // RUN
: llvm-mc
-triple aarch64-windows
-filetype obj
-o
%t.obj
%s
2 // RUN
: llvm-rtdyld
-triple aarch64-windows
-dummy-extern dummy
=0x79563413 -dummy-extern dummyA
=0x78566879 -target-addr-start
=40960000000000 -verify
-check
%s
%t.obj
25 .globl _test_adr_relocation
28 # IMAGE_REL_ARM64_REL21
29 # rtdyld-check: decode_operand(adr1, 1) = (_const[20:0] - adr1[20:0])
35 .globl _test_branch26_reloc
38 # IMAGE_REL_ARM64_BRANCH26, test long branch
39 # rtdyld-check: decode_operand(brel, 0)[25:0] = (stub_addr(COFF_AArch64.s.tmp.obj/.text, dummy) - brel)[27:2]
45 .globl _test_branch19_reloc
48 # IMAGE_REL_ARM64_BRANCH19
49 # rtdyld-check: decode_operand(bcond, 1)[18:0] = (_foo - bcond)[20:2]
57 .globl _test_branch14_reloc
60 # IMAGE_REL_ARM64_BRANCH14
61 # rtdyld-check: decode_operand(tbz_branch, 2)[13:0] = (_bnamed - tbz_branch)[15:2]
68 .globl _test_adrp_ldr_reloc
71 # IMAGE_REL_ARM64_PAGEBASE_REL21
72 # rtdyld-check: decode_operand(adrp1, 1) = (_const[32:12] - adrp1[32:12])
77 # IMAGE_REL_ARM64_PAGEOFFSET_12L
78 # rtdyld-check: decode_operand(ldr1, 2) = _const[11:3]
80 ldr x0
, [x0
, #:lo12:_const]
83 .globl _test_add_reloc
86 # IMAGE_REL_ARM64_PAGEOFFSET_12A
87 # rtdyld-check: decode_operand(add1, 2) = (tgt+4)[11:0]
90 add x0
, x0
, tgt@PAGEOFF+
4
94 .globl _test_addr64_reloc
97 # IMAGE_REL_ARM64_ADDR64
98 # rtdyld-check: *{8}addr64 = tgt+4
103 # IMAGE_REL_ARM64_ADDR32
104 # rtdyld-check: *{4}_test_addr32_reloc = 0x78566879
111 # IMAGE_REL_ARM64_ADDR32NB, RVA of the target
112 # rtdyld-check: *{4}_relocations = _foo - 40960000000000
116 # IMAGE_REL_ARM64_ADDR32NB
117 # rtdyld-check: *{4}imgrel2 = _string - 40960000000000+5
119 .long _string@IMGREL+5
121 # IMAGE_REL_ARM64_SECTION
122 # rtdyld-check: *{2}secindex = 1
124 .secidx _test_addr32_reloc
126 # IMAGE_REL_ARM64_SECREL
127 # rtdyld-check: *{4}secrel = string - section_addr(COFF_AArch64.s.tmp.obj, .data)
134 .quad 4614256650576692846
146 .asciz "Hello World\n"
152 .asciz "Hello World\n"