2 # RUN: rm -rf %t && split-file %s %t
4 ## Check recompile with -fPIC error message
5 # RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %t/shared.s -o %t/shared.o
6 # RUN: not ld.lld -shared %t/shared.o -o /dev/null 2>&1 | FileCheck %s
8 # CHECK: error: relocation R_390_PC32 cannot be used against symbol '_shared'; recompile with -fPIC
9 # CHECK: >>> defined in {{.*}}
10 # CHECK: >>> referenced by {{.*}}:(.data+0x1)
12 ## Check patching of negative addends
14 # RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=1 %t/addend.s -o %t/1.o
15 # RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=2147483648 %t/addend.s -o %t/2.o
16 # RUN: llvm-mc -filetype=obj -triple=s390x -defsym ADDEND=2147483649 %t/addend.s -o %t/3.o
18 # RUN: ld.lld --section-start=.text=0x0 %t/1.o -o %t/1out
19 # RUN: ld.lld --section-start=.text=0x0 %t/2.o -o %t/2out
20 # RUN: not ld.lld --section-start=.text=0x0 %t/3.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/3.o --check-prefix RANGE
22 # RANGE: error: [[FILE]]:(.text+0x0): relocation R_390_PC32 out of range
24 # RUN: llvm-readelf --hex-dump=.text %t/1out | FileCheck %s -DADDEND=ffffffff --check-prefix DUMP
25 # RUN: llvm-readelf --hex-dump=.text %t/2out | FileCheck %s -DADDEND=80000000 --check-prefix DUMP
27 # DUMP: 0x00000000 [[ADDEND]]
38 .reloc ., R_390_PC32, .text-ADDEND