OSDN Git Service

Update aosp/master LLVM for rebase to r256229
[android-x86/external-llvm.git] / test / MC / MachO / ARM / long-call-branch-island-relocation.s
1 @ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.o
2 @ RUN: llvm-readobj -relocations -expand-relocs < %t.o | FileCheck %s
3
4 @ rdar://12359919
5
6         .syntax unified
7         .text
8
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}
18
19
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.
25
26   .space 20000000
27
28   .section      __TEXT,initcode,regular,pure_instructions
29
30         .globl  _foo
31         .align  2
32         .code   16
33 _foo:
34         push    {r7, lr}
35         mov     r7, sp
36         pop     {r7, pc}
37
38
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: ]