54 lines · plain
1@ RUN: llvm-mc -n -triple armv7-apple-darwin10 %s -filetype=obj -o %t.o2@ RUN: llvm-readobj -r --expand-relocs - < %t.o | FileCheck %s3 4@ rdar://123599195 6 .syntax unified7 .text8 9 .globl _bar10 .align 211 .code 1612 .thumb_func _bar13_bar:14 push {r7, lr}15 mov r7, sp16 bl _foo17 pop {r7, pc}18 19 20_junk:21@ Make the _foo symbol sufficiently far away to force the 'bl' relocation22@ above to be out of range. On Darwin, the assembler deals with this by23@ generating an external relocation so the linker can create a branch24@ island.25 26 .space 2000000027 28 .section __TEXT,initcode,regular,pure_instructions29 30 .globl _foo31 .align 232 .code 1633_foo:34 push {r7, lr}35 mov r7, sp36 pop {r7, pc}37 38 39@ CHECK: File: <stdin>40@ CHECK: Format: Mach-O arm41@ CHECK: Arch: arm42@ CHECK: AddressSize: 32bit43@ CHECK: Relocations [44@ CHECK: Section __text {45@ CHECK: Relocation {46@ CHECK: Offset: 0x447@ CHECK: PCRel: 148@ CHECK: Length: 249@ CHECK: Type: ARM_THUMB_RELOC_BR22 (6)50@ CHECK: Symbol: _foo (2)51@ CHECK: }52@ CHECK: }53@ CHECK: ]54