xref: /aosp_15_r20/external/llvm/test/MC/MachO/x86_32-scattered-reloc-fallback.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -s -sd | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker// rdar://15526046
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker.text
6*9880d681SAndroid Build Coastguard Worker.globl _main
7*9880d681SAndroid Build Coastguard Worker_main:
8*9880d681SAndroid Build Coastguard Worker	.space 0x01020f55, 0x90
9*9880d681SAndroid Build Coastguard Workerbug:
10*9880d681SAndroid Build Coastguard Worker	movl  $0, _key64b_9+4
11*9880d681SAndroid Build Coastguard Worker.section __TEXT, __padding
12*9880d681SAndroid Build Coastguard Worker	.space 0x515b91, 0
13*9880d681SAndroid Build Coastguard Worker.data
14*9880d681SAndroid Build Coastguard Worker	.space 0xa70, 0
15*9880d681SAndroid Build Coastguard Worker.globl _key64b_9
16*9880d681SAndroid Build Coastguard Worker_key64b_9:
17*9880d681SAndroid Build Coastguard Worker	.long 1
18*9880d681SAndroid Build Coastguard Worker	.long 2
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker// The movl instruction above should produce this encoding where the address
21*9880d681SAndroid Build Coastguard Worker// of _key64b_9 is at 0x01537560.  This is testing falling back from using a
22*9880d681SAndroid Build Coastguard Worker// scattered relocation to a normal relocation because the offset from the
23*9880d681SAndroid Build Coastguard Worker// start of the section is more than 24-bits.  But need to get the item to
24*9880d681SAndroid Build Coastguard Worker// be relocated, in this case _key64b_9+4, value correct in the instruction.
25*9880d681SAndroid Build Coastguard Worker// 01020f55	c7056475530100000000	movl	$0x0, 0x1537564
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker// CHECK: SectionData (
28*9880d681SAndroid Build Coastguard Worker// CHECK: F75530: 90909090 90909090 90909090 90909090  |................|
29*9880d681SAndroid Build Coastguard Worker// CHECK: 1020F50: 90909090 90C70564 75530100 000000    |.......duS.....|
30*9880d681SAndroid Build Coastguard Worker// CHECK: 75530: 00000000 00000000 00000000 00000000  |................|
31*9880d681SAndroid Build Coastguard Worker// CHECK: )
32