xref: /aosp_15_r20/external/llvm/test/ExecutionEngine/RuntimeDyld/SystemZ/cfi-relo-pc64.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// Test that R_390_PC32 and R_390_PC64 relocations can be generated.
2*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple s390x-linux-gnu -filetype=obj %s -o - | llvm-readobj -s -sr -sd | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker// Test that RuntimeDyld can fix up such relocations.
5*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple s390x-linux-gnu  -filetype=obj %s -o %T/test-s390x-cfi-relo-pc64.o
6*9880d681SAndroid Build Coastguard Worker// RUN: llc -mtriple=s390x-linux-gnu -filetype=obj %S/Inputs/rtdyld-globals.ll -o %T/test-s390x-rtdyld-globals.o
7*9880d681SAndroid Build Coastguard Worker// RUN: llvm-rtdyld -triple=s390x-linux-gnu -verify %T/test-s390x-cfi-relo-pc64.o %T/test-s390x-rtdyld-globals.o
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerf1:
10*9880d681SAndroid Build Coastguard Worker    .cfi_startproc
11*9880d681SAndroid Build Coastguard Worker    .cfi_personality 0x9c, foo // DW_EH_PE_indirect|DW_EH_PE_pcrel|DW_EH_PE_sdata8 (0x9c)
12*9880d681SAndroid Build Coastguard Worker    lr %r0, %r0
13*9880d681SAndroid Build Coastguard Worker    .cfi_endproc
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker// CHECK:        Section {
16*9880d681SAndroid Build Coastguard Worker// CHECK:          Index:
17*9880d681SAndroid Build Coastguard Worker// CHECK:          Name: .rela.eh_frame
18*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Type: SHT_RELA
19*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Flags [
20*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     ]
21*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Address: 0x0
22*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Offset:
23*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Size: 48
24*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Link:
25*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Info:
26*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     AddressAlignment: 8
27*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     EntrySize: 24
28*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     Relocations [
29*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:       0x12 R_390_PC64 foo 0x0
30*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:       0x28 R_390_PC32 .text 0x0
31*9880d681SAndroid Build Coastguard Worker// CHECK-NEXT:     ]
32*9880d681SAndroid Build Coastguard Worker// CHECK:        }
33