51 lines · plain
1; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \2; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names < %s | FileCheck %s --check-prefix=CHECK-S3; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \4; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names --filetype=obj -o %t.o < %s5; RUN: llvm-objdump --mcpu=pwr10 -dr %t.o | FileCheck %s --check-prefix=CHECK-O6; RUN: llvm-readelf -s %t.o | FileCheck %s --check-prefix=CHECK-SYM7 8; These test cases are to ensure that when using pc relative memory operations9; ABI correct code and relocations are produced for Initial Exec TLS Model.10; Note that with R_PPC64_TLS relocations, to distinguish PC relative11; TLS the relocation has a field value displaced by one byte from the12; beginning of the instruction.13 14@x = external thread_local global i32, align 415 16define ptr @InitialExecAddressLoad() {17; CHECK-S-LABEL: InitialExecAddressLoad:18; CHECK-S: # %bb.0: # %entry19; CHECK-S-NEXT: pld r3, x@got@tprel@pcrel(0), 120; CHECK-S-NEXT: add r3, r3, x@tls@pcrel21; CHECK-S-NEXT: blr22; CHECK-O-LABEL: <InitialExecAddressLoad>:23; CHECK-O: 00 00 10 04 00 00 60 e4 pld 3, 0(0), 124; CHECK-O-NEXT: 0000000000000000: R_PPC64_GOT_TPREL_PCREL34 x25; CHECK-O-NEXT: 14 6a 63 7c add 3, 3, 1326; CHECK-O-NEXT: 0000000000000009: R_PPC64_TLS x27; CHECK-O-NEXT: 20 00 80 4e blr28entry:29 ret ptr @x30}31 32define i32 @InitialExecValueLoad() {33; CHECK-S-LABEL: InitialExecValueLoad:34; CHECK-S: # %bb.0: # %entry35; CHECK-S-NEXT: pld r3, x@got@tprel@pcrel(0), 136; CHECK-S-NEXT: lwzx r3, r3, x@tls@pcrel37; CHECK-S-NEXT: blr38; CHECK-O-LABEL: <InitialExecValueLoad>:39; CHECK-O: 00 00 10 04 00 00 60 e4 pld 3, 0(0), 140; CHECK-O-NEXT: 0000000000000020: R_PPC64_GOT_TPREL_PCREL34 x41; CHECK-O-NEXT: 2e 68 63 7c lwzx 3, 3, 1342; CHECK-O-NEXT: 0000000000000029: R_PPC64_TLS x43; CHECK-O-NEXT: 20 00 80 4e blr44 45; CHECK-SYM-LABEL: Symbol table '.symtab' contains 6 entries46; CHECK-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x47entry:48 %0 = load i32, ptr @x, align 449 ret i32 %050}51