1 # RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -code-model=small -relocation-model=pic -filetype=obj -o %t.o %s
2 # RUN: llvm-rtdyld -triple=arm64-apple-ios7.0.0 -verify -check=%s %t.o
5 # FIXME: Add GOT relocation tests once GOT testing is supported.
7 .section __TEXT,__text,regular,pure_instructions
15 .globl _test_branch_reloc
19 # Test ARM64_RELOC_BRANCH26 relocation. The branch instruction only encodes 26
20 # bits of the 28-bit possible branch range. The lower two bits are always zero
21 # and therefore ignored.
22 # rtdyld-check: decode_operand(br1, 0)[25:0] = (foo-br1)[27:2]
29 # Test ARM64_RELOC_UNSIGNED relocation. The absolute 64-bit address of the
30 # function should be stored at the 8-byte memory location.
31 # rtdyld-check: *{8}ptr = foo
32 .section __DATA,__data
40 # Test ARM64_RELOC_PAGE21 and ARM64_RELOC_PAGEOFF12 relocation. adrp encodes
41 # the PC-relative page (4 KiB) difference between the adrp instruction and the
42 # variable ptr. ldr encodes the offset of the variable within the page. The ldr
43 # instruction perfroms an implicit shift on the encoded immediate (imm<<3).
44 # rtdyld-check: decode_operand(adrp1, 1) = (ptr[32:12]-adrp1[32:12])
45 # rtdyld-check: decode_operand(ldr1, 2) = (ptr[11:3])
52 ldr x0, [x0, ptr@PAGEOFF]