xref: /aosp_15_r20/external/llvm/test/MC/MachO/i386-large-relocations.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple i386-apple-darwin10 %s -filetype=obj -o - | llvm-readobj -r | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker.space 0x1ed280
4*9880d681SAndroid Build Coastguard Worker       .section        __DATA,__const
5*9880d681SAndroid Build Coastguard Worker       .align  4
6*9880d681SAndroid Build Coastguard Worker.space 0x5181020
7*9880d681SAndroid Build Coastguard Worker_foo:
8*9880d681SAndroid Build Coastguard Worker       .long   _bar
9*9880d681SAndroid Build Coastguard Worker       .long   0
10*9880d681SAndroid Build Coastguard Worker       .long   _bar+8
11*9880d681SAndroid Build Coastguard Worker       .long   _bar+24
12*9880d681SAndroid Build Coastguard Worker       .long   0
13*9880d681SAndroid Build Coastguard Worker       .long   _bar+16
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker.zerofill __DATA,__bss,__dummy,0x5d780
16*9880d681SAndroid Build Coastguard Worker.zerofill __DATA,__bss,_bar,48,4
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker// Normally scattered relocations are used for sym+offset expressions. When
19*9880d681SAndroid Build Coastguard Worker// the value exceeds 24-bits, however, it's outside what MachO can encode,
20*9880d681SAndroid Build Coastguard Worker// so the assembler falls back to non-scattered relocations.
21*9880d681SAndroid Build Coastguard Worker// rdar://12358909
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker// CHECK: Relocations [
24*9880d681SAndroid Build Coastguard Worker// CHECK:   Section __const {
25*9880d681SAndroid Build Coastguard Worker// CHECK:     0x5181034 0 2 0 GENERIC_RELOC_VANILLA 0 __bss
26*9880d681SAndroid Build Coastguard Worker// CHECK:     0x518102C 0 2 0 GENERIC_RELOC_VANILLA 0 __bss
27*9880d681SAndroid Build Coastguard Worker// CHECK:     0x5181028 0 2 0 GENERIC_RELOC_VANILLA 0 __bss
28*9880d681SAndroid Build Coastguard Worker// CHECK:     0x5181020 0 2 0 GENERIC_RELOC_VANILLA 0 __bss
29*9880d681SAndroid Build Coastguard Worker// CHECK:   }
30*9880d681SAndroid Build Coastguard Worker// CHECK: ]
31