XFAIL the test on MIPS
[oota-llvm.git] / test / ExecutionEngine / RuntimeDyld / AArch64 / MachO_ARM64_relocations.s
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
3 # RUN: rm %t.o
4 # XFAIL: mips
5
6 # FIXME: Add GOT relocation tests once GOT testing is supported.
7
8     .section  __TEXT,__text,regular,pure_instructions
9     .ios_version_min 7, 0
10     .globl  foo
11     .align  2
12 foo:
13     movz  w0, #0
14     ret
15
16     .globl  _test_branch_reloc
17     .align  2
18
19
20 # Test ARM64_RELOC_BRANCH26 relocation. The branch instruction only encodes 26
21 # bits of the 28-bit possible branch range. The lower two bits are always zero
22 # and therefore ignored.
23 # rtdyld-check:  decode_operand(br1, 0)[25:0] = (foo-br1)[27:2]
24 _test_branch_reloc:
25 br1:
26     b foo
27     ret
28
29
30 # Test ARM64_RELOC_UNSIGNED relocation. The absolute 64-bit address of the
31 # function should be stored at the 8-byte memory location.
32 # rtdyld-check: *{8}ptr = foo
33     .section  __DATA,__data
34     .globl  ptr
35     .align  3
36     .fill 8192, 1, 0
37 ptr:
38     .quad foo
39
40
41 # Test ARM64_RELOC_PAGE21 and ARM64_RELOC_PAGEOFF12 relocation. adrp encodes
42 # the PC-relative page (4 KiB) difference between the adrp instruction and the
43 # variable ptr. ldr encodes the offset of the variable within the page. The ldr
44 # instruction perfroms an implicit shift on the encoded immediate (imm<<3).
45 # rtdyld-check:  decode_operand(adrp1, 1) = (ptr[32:12]-adrp1[32:12])
46 # rtdyld-check:  decode_operand(ldr1, 2) = (ptr[11:3])
47     .globl  _test_adrp_ldr
48     .align  2
49 _test_adrp_ldr:
50 adrp1:
51     adrp x0, ptr@PAGE
52 ldr1:
53     ldr  x0, [x0, ptr@PAGEOFF]
54     ret
55     .fill 8192, 1, 0