86041835591f484ac32f8fffb0348c2622b5be60
[oota-llvm.git] / test / ExecutionEngine / RuntimeDyld / ARM / MachO_ARM_PIC_relocations.s
1 # RUN: llvm-mc -triple=armv7s-apple-ios7.0.0 -relocation-model=pic -filetype=obj -o %t.o %s
2 # RUN: llvm-rtdyld -triple=armv7s-apple-ios7.0.0 -verify -check=%s %t.o
3 # RUN: rm %t.o
4
5         .syntax unified
6         .section        __TEXT,__text,regular,pure_instructions
7         .globl  bar
8         .align  2
9 bar:
10 # Check lower 16-bits of section difference relocation
11 # rtdyld-check: decode_operand(insn1, 1) = (foo-(nextPC+8))[15:0]
12 insn1:
13         movw    r0, :lower16:(foo-(nextPC+8))
14 # Check upper 16-bits of section difference relocation
15 # rtdyld-check: decode_operand(insn2, 2) = (foo-(nextPC+8))[31:16]
16 insn2:
17         movt    r0, :upper16:(foo-(nextPC+8))
18 nextPC:
19         add     r0, pc, r0
20         bx      lr
21
22         .globl  foo
23         .align  2
24 foo:
25         bx      lr
26
27 .subsections_via_symbols