2 # RUN: llvm-mc -triple s390x-unknown-unknown --show-encoding %s | FileCheck %s
4 # RUN: llvm-mc -triple s390x-unknown-unknown -filetype=obj %s | \
5 # RUN: llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL
7 # CHECK: larl %r14, target # encoding: [0xc0,0xe0,A,A,A,A]
8 # CHECK-NEXT: # fixup A - offset: 2, value: target+2, kind: FK_390_PC32DBL
9 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PC32DBL target 0x2
13 # CHECK: larl %r14, target@GOT # encoding: [0xc0,0xe0,A,A,A,A]
14 # CHECK-NEXT: # fixup A - offset: 2, value: target@GOT+2, kind: FK_390_PC32DBL
15 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_GOTENT target 0x2
19 # CHECK: larl %r14, target@INDNTPOFF # encoding: [0xc0,0xe0,A,A,A,A]
20 # CHECK-NEXT: # fixup A - offset: 2, value: target@INDNTPOFF+2, kind: FK_390_PC32DBL
21 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_TLS_IEENT target 0x2
23 larl
%r14, target@indntpoff
25 # CHECK: brasl %r14, target # encoding: [0xc0,0xe5,A,A,A,A]
26 # CHECK-NEXT: # fixup A - offset: 2, value: target+2, kind: FK_390_PC32DBL
27 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PC32DBL target 0x2
31 # CHECK: brasl %r14, target@PLT # encoding: [0xc0,0xe5,A,A,A,A]
32 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC32DBL
33 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT32DBL target 0x2
35 brasl
%r14, target@plt
37 # CHECK: brasl %r14, target@PLT:tls_gdcall:sym # encoding: [0xc0,0xe5,A,A,A,A]
38 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC32DBL
39 # CHECK-NEXT: # fixup B - offset: 0, value: sym@TLSGD, kind: FK_390_TLS_CALL
40 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT32DBL target 0x2
41 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GDCALL sym 0x0
43 brasl
%r14, target@plt
:tls_gdcall
:sym
45 # CHECK: brasl %r14, target@PLT:tls_ldcall:sym # encoding: [0xc0,0xe5,A,A,A,A]
46 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC32DBL
47 # CHECK-NEXT: # fixup B - offset: 0, value: sym@TLSLDM, kind: FK_390_TLS_CALL
48 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT32DBL target 0x2
49 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDCALL sym 0x0
51 brasl
%r14, target@plt
:tls_ldcall
:sym
53 # CHECK: bras %r14, target # encoding: [0xa7,0xe5,A,A]
54 # CHECK-NEXT: # fixup A - offset: 2, value: target+2, kind: FK_390_PC16DBL
55 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PC16DBL target 0x2
59 # CHECK: bras %r14, target@PLT # encoding: [0xa7,0xe5,A,A]
60 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC16DBL
61 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT16DBL target 0x2
65 # CHECK: bras %r14, target@PLT:tls_gdcall:sym # encoding: [0xa7,0xe5,A,A]
66 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC16DBL
67 # CHECK-NEXT: # fixup B - offset: 0, value: sym@TLSGD, kind: FK_390_TLS_CALL
68 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT16DBL target 0x2
69 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GDCALL sym 0x0
71 bras
%r14, target@plt
:tls_gdcall
:sym
73 # CHECK: bras %r14, target@PLT:tls_ldcall:sym # encoding: [0xa7,0xe5,A,A]
74 # CHECK-NEXT: # fixup A - offset: 2, value: target@PLT+2, kind: FK_390_PC16DBL
75 # CHECK-NEXT: # fixup B - offset: 0, value: sym@TLSLDM, kind: FK_390_TLS_CALL
76 # CHECK-REL: 0x{{[0-9A-F]*2}} R_390_PLT16DBL target 0x2
77 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDCALL sym 0x0
79 bras
%r14, target@plt
:tls_ldcall
:sym
83 # llvm-mc does not show any "encoding" string for data, so we just check the relocs
85 # CHECK-REL: .rela.data
88 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LE64 target 0x0
92 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDO64 target 0x0
96 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDM64 target 0x0
100 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GD64 target 0x0
104 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LE32 target 0x0
108 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDO32 target 0x0
112 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDM32 target 0x0
116 # CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GD32 target 0x0