[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / MachO / ARM / long-call-branch-island-relocation.s
blobe781c6d561886fb5fb590ebc14b77e7097377a96
1 @ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.o
2 @ RUN: llvm-readobj -r --expand-relocs < %t.o | FileCheck %s
4 @ rdar://12359919
6 .syntax unified
7 .text
9 .globl _bar
10 .align 2
11 .code 16
12 .thumb_func _bar
13 _bar:
14 push {r7, lr}
15 mov r7, sp
16 bl _foo
17 pop {r7, pc}
20 _junk:
21 @ Make the _foo symbol sufficiently far away to force the 'bl' relocation
22 @ above to be out of range. On Darwin, the assembler deals with this by
23 @ generating an external relocation so the linker can create a branch
24 @ island.
26 .space 20000000
28 .section __TEXT,initcode,regular,pure_instructions
30 .globl _foo
31 .align 2
32 .code 16
33 _foo:
34 push {r7, lr}
35 mov r7, sp
36 pop {r7, pc}
39 @ CHECK: File: <stdin>
40 @ CHECK: Format: Mach-O arm
41 @ CHECK: Arch: arm
42 @ CHECK: AddressSize: 32bit
43 @ CHECK: Relocations [
44 @ CHECK: Section __text {
45 @ CHECK: Relocation {
46 @ CHECK: Offset: 0x4
47 @ CHECK: PCRel: 1
48 @ CHECK: Length: 2
49 @ CHECK: Type: ARM_THUMB_RELOC_BR22 (6)
50 @ CHECK: Symbol: _foo (2)
51 @ CHECK: }
52 @ CHECK: }
53 @ CHECK: ]