1 2# RUN: llvm-mc -triple s390x-unknown-unknown --show-encoding %s | FileCheck %s 3 4# RUN: llvm-mc -triple s390x-unknown-unknown -filetype=obj %s | \ 5# RUN: llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL 6 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 10 .align 16 11 larl %r14, target 12 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 16 .align 16 17 larl %r14, target@got 18 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 22 .align 16 23 larl %r14, target@indntpoff 24 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 28 .align 16 29 brasl %r14, target 30 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 34 .align 16 35 brasl %r14, target@plt 36 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 42 .align 16 43 brasl %r14, target@plt:tls_gdcall:sym 44 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 50 .align 16 51 brasl %r14, target@plt:tls_ldcall:sym 52 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 56 .align 16 57 bras %r14, target 58 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 62 .align 16 63 bras %r14, target@plt 64 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 70 .align 16 71 bras %r14, target@plt:tls_gdcall:sym 72 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 78 .align 16 79 bras %r14, target@plt:tls_ldcall:sym 80 81 82# Data relocs 83# llvm-mc does not show any "encoding" string for data, so we just check the relocs 84 85# CHECK-REL: .rela.data 86 .data 87 88# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LE64 target 0x0 89 .align 16 90 .quad target@ntpoff 91 92# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDO64 target 0x0 93 .align 16 94 .quad target@dtpoff 95 96# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDM64 target 0x0 97 .align 16 98 .quad target@tlsldm 99 100# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GD64 target 0x0 101 .align 16 102 .quad target@tlsgd 103 104# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LE32 target 0x0 105 .align 16 106 .long target@ntpoff 107 108# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDO32 target 0x0 109 .align 16 110 .long target@dtpoff 111 112# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_LDM32 target 0x0 113 .align 16 114 .long target@tlsldm 115 116# CHECK-REL: 0x{{[0-9A-F]*0}} R_390_TLS_GD32 target 0x0 117 .align 16 118 .long target@tlsgd 119 120