Files
TheRock/compiler/amd-llvm/lld/test/ELF/ppc64-tls-pcrel-gd.s
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

95 lines
3.5 KiB
ArmAsm

# REQUIRES: ppc
# RUN: split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/asm -o %t.o
# RUN: llvm-mc -filetype=obj -triple=powerpc64le %t/defs -o %t-defs.o
# RUN: ld.lld --shared %t-defs.o --soname=t-defs -o %t-defs.so
# RUN: ld.lld -T %t/lds --shared %t.o -o %t-gd.so
# RUN: ld.lld -T %t/lds %t.o %t-defs.so -o %t-gdtoie
# RUN: ld.lld -T %t/lds %t.o %t-defs.o -o %t-gdtole
# RUN: llvm-readelf -r %t-gd.so | FileCheck %s --check-prefix=GD-RELOC
# RUN: llvm-readelf -s %t-gd.so | FileCheck %s --check-prefix=GD-SYM
# RUN: llvm-objdump -d --no-show-raw-insn %t-gd.so | FileCheck %s --check-prefix=GD
# RUN: llvm-readelf -r %t-gdtoie | FileCheck %s --check-prefix=GDTOIE-RELOC
# RUN: llvm-readelf -s %t-gdtoie | FileCheck %s --check-prefix=GDTOIE-SYM
# RUN: llvm-objdump -d --no-show-raw-insn %t-gdtoie | FileCheck %s --check-prefix=GDTOIE
# RUN: llvm-readelf -r %t-gdtole | FileCheck %s --check-prefix=GDTOLE-RELOC
# RUN: llvm-readelf -s %t-gdtole | FileCheck %s --check-prefix=GDTOLE-SYM
# RUN: llvm-objdump -d --no-show-raw-insn %t-gdtole | FileCheck %s --check-prefix=GDTOLE
## This test checks the General Dynamic PC Relative TLS implementation for lld.
## GD - General Dynamic with no relaxation possible
## GDTOIE - General Dynamic relaxed to Initial Exec
## GDTOLE - General Dynamic relaxed to Local Exec
#--- lds
SECTIONS {
.text_addr 0x1001000 : { *(.text_addr) }
}
#--- defs
.section .tbss,"awT",@nobits
.globl x
x:
.long 0
.globl y
y:
.long 0
#--- asm
# GD-RELOC: Relocation section '.rela.dyn' at offset 0x100b8 contains 4 entries:
# GD-RELOC: 0000000001001188 0000000100000044 R_PPC64_DTPMOD64 0000000000000000 x + 0
# GD-RELOC: 0000000001001190 000000010000004e R_PPC64_DTPREL64 0000000000000000 x + 0
# GD-RELOC: 0000000001001198 0000000300000044 R_PPC64_DTPMOD64 0000000000000000 y + 0
# GD-RELOC: 00000000010011a0 000000030000004e R_PPC64_DTPREL64 0000000000000000 y + 0
# GD-SYM: Symbol table '.dynsym' contains 4 entries:
# GD-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
# GD-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
# GDTOIE-RELOC: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 2 entries:
# GDTOIE-RELOC: 00000000010010f8 0000000100000049 R_PPC64_TPREL64 0000000000000000 x + 0
# GDTOIE-RELOC: 0000000001001100 0000000300000049 R_PPC64_TPREL64 0000000000000000 y + 0
# GDTOIE-SYM: Symbol table '.dynsym' contains 4 entries:
# GDTOIE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
# GDTOIE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
# GDTOLE-RELOC: There are no relocations in this file.
# GDTOLE-SYM: Symbol table '.symtab' contains 5 entries:
# GDTOLE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT 3 x
# GDTOLE-SYM: 0000000000000004 0 TLS GLOBAL DEFAULT 3 y
# GD-LABEL: <GDTwoVal>:
# GD-NEXT: paddi 3, 0, 392, 1
# GD-NEXT: bl
# GD-NEXT: paddi 3, 0, 396, 1
# GD-NEXT: bl
# GD-NEXT: blr
# GDTOIE-LABEL: <GDTwoVal>:
# GDTOIE-NEXT: pld 3, 248(0), 1
# GDTOIE-NEXT: add 3, 3, 13
# GDTOIE-NEXT: pld 3, 244(0), 1
# GDTOIE-NEXT: add 3, 3, 13
# GDTOIE-NEXT: blr
# GDTOLE-LABEL: <GDTwoVal>:
# GDTOLE-NEXT: paddi 3, 13, -28672, 0
# GDTOLE-NEXT: nop
# GDTOLE-NEXT: paddi 3, 13, -28668, 0
# GDTOLE-NEXT: nop
# GDTOLE-NEXT: blr
.section .text_addr, "ax", %progbits
GDTwoVal:
paddi 3, 0, x@got@tlsgd@pcrel, 1
bl __tls_get_addr@notoc(x@tlsgd)
paddi 3, 0, y@got@tlsgd@pcrel, 1
bl __tls_get_addr@notoc(y@tlsgd)
blr