xref: /aosp_15_r20/external/llvm/test/MC/ARM/macho-relocs-with-addend.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker@ RUN: llvm-mc -triple thumbv7-apple-ios7.0 -filetype=obj -o - %s | \
2*9880d681SAndroid Build Coastguard Worker@ RUN: llvm-readobj -r - | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker        @ MachO relocations that end up expressed as internal
5*9880d681SAndroid Build Coastguard Worker        @ (scattered) still need to have the type set correctly.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker        .text
8*9880d681SAndroid Build Coastguard Worker        .thumb_func
9*9880d681SAndroid Build Coastguard Worker        .thumb
10*9880d681SAndroid Build Coastguard Worker        .globl _with_thumb
11*9880d681SAndroid Build Coastguard Worker_with_thumb:
12*9880d681SAndroid Build Coastguard Worker        bl _dest+10
13*9880d681SAndroid Build Coastguard Worker        blx _dest+20
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker        .globl _with_arm
16*9880d681SAndroid Build Coastguard Worker        .arm
17*9880d681SAndroid Build Coastguard Worker_with_arm:
18*9880d681SAndroid Build Coastguard Worker        bl _dest+10
19*9880d681SAndroid Build Coastguard Worker        blx _dest+20
20*9880d681SAndroid Build Coastguard Worker        bne _dest+30
21*9880d681SAndroid Build Coastguard Worker        b _dest+40
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker        .data
24*9880d681SAndroid Build Coastguard Worker_dest:
25*9880d681SAndroid Build Coastguard Worker        .word 42
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker@ CHECK: Relocations [
28*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: Section __text {
29*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0x14 1 2 n/a ARM_RELOC_BR24 1 0x18
30*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0x10 1 2 n/a ARM_RELOC_BR24 1 0x18
31*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0xC 1 2 n/a ARM_RELOC_BR24 1 0x18
32*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0x8 1 2 n/a ARM_RELOC_BR24 1 0x18
33*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0x4 1 2 n/a ARM_THUMB_RELOC_BR22 1 0x18
34*9880d681SAndroid Build Coastguard Worker@ CHECK-NEXT: 0x0 1 2 n/a ARM_THUMB_RELOC_BR22 1 0x18
35