xref: /aosp_15_r20/external/llvm/test/MC/MachO/darwin-x86_64-diff-reloc-assign.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple x86_64-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -r | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker// Test case for rdar://10743265
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker// This tests that this expression does not cause a crash and produces two
6*9880d681SAndroid Build Coastguard Worker// relocation entries:
7*9880d681SAndroid Build Coastguard Worker// Relocation information (__TEXT,__text) 2 entries
8*9880d681SAndroid Build Coastguard Worker// address  pcrel length extern type    scattered symbolnum/value
9*9880d681SAndroid Build Coastguard Worker// 00000000 False long   True   SUB     False     _base
10*9880d681SAndroid Build Coastguard Worker// 00000000 False long   True   UNSIGND False     _start_ap_2
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker_base = .
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker.long (0x2000) + _start_ap_2 - _base
15*9880d681SAndroid Build Coastguard Worker.word 0
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker_start_ap_2:
18*9880d681SAndroid Build Coastguard Worker        cli
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker// CHECK: Relocations [
21*9880d681SAndroid Build Coastguard Worker// CHECK:   Section __text {
22*9880d681SAndroid Build Coastguard Worker// CHECK:     0x0 0 2 1 X86_64_RELOC_SUBTRACTOR 0 _base
23*9880d681SAndroid Build Coastguard Worker// CHECK:     0x0 0 2 1 X86_64_RELOC_UNSIGNED 0 _start_ap_2
24*9880d681SAndroid Build Coastguard Worker// CHECK:   }
25*9880d681SAndroid Build Coastguard Worker// CHECK: ]
26