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
191 lines
3.2 KiB
ArmAsm
191 lines
3.2 KiB
ArmAsm
# REQUIRES: x86_64-linux
|
|
# RUN: rm -rf %t && mkdir -p %t
|
|
# RUN: split-file %s %t
|
|
# RUN: llvm-mc -triple=x86_64-unknown-linux -filetype=obj -o %t/test_runner.o %t/test_runner.s
|
|
# RUN: llvm-mc -triple=x86_64-unknown-linux -filetype=obj -o %t/external_tls.o %t/external_tls.s
|
|
# RUN: llvm-rtdyld -triple=x86_64-unknown-linux -execute %t/test_runner.o %t/external_tls.o
|
|
|
|
#--- test_runner.s
|
|
|
|
_main:
|
|
|
|
push %rbx
|
|
# load the address of the GOT in rbx for the large code model tests
|
|
lea _GLOBAL_OFFSET_TABLE_(%rip), %rbx
|
|
|
|
# Test Local Exec TLS Model
|
|
mov %fs:tls_foo@tpoff, %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $1, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
mov %fs:tls_bar@tpoff, %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $2, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# Test Initial Exec TLS Model
|
|
mov tls_foo@gottpoff(%rip), %rax
|
|
mov %fs:(%rax), %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $3, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
mov tls_bar@gottpoff(%rip), %rax
|
|
mov %fs:(%rax), %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $4, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# Test Local Dynamic TLS Model (small code model)
|
|
lea tls_foo@tlsld(%rip), %rdi
|
|
call __tls_get_addr@plt
|
|
mov tls_foo@dtpoff(%rax), %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $5, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
lea tls_bar@tlsld(%rip), %rdi
|
|
call __tls_get_addr@plt
|
|
mov tls_bar@dtpoff(%rax), %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $6, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# Test Local Dynamic TLS Model (large code model)
|
|
lea tls_foo@tlsld(%rip), %rdi
|
|
movabs $__tls_get_addr@pltoff, %rax
|
|
add %rbx, %rax
|
|
call *%rax
|
|
mov tls_foo@dtpoff(%rax), %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $7, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
lea tls_bar@tlsld(%rip), %rdi
|
|
movabs $__tls_get_addr@pltoff, %rax
|
|
add %rbx, %rax
|
|
call *%rax
|
|
mov tls_bar@dtpoff(%rax), %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $8, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# Test Global Dynamic TLS Model (small code model)
|
|
.byte 0x66
|
|
leaq tls_foo@tlsgd(%rip), %rdi
|
|
.byte 0x66, 0x66, 0x48
|
|
call __tls_get_addr@plt
|
|
mov (%rax), %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $9, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
.byte 0x66
|
|
leaq tls_bar@tlsgd(%rip), %rdi
|
|
.byte 0x66, 0x66, 0x48
|
|
call __tls_get_addr@plt
|
|
mov (%rax), %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $10, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# Test Global Dynamic TLS Model (large code model)
|
|
lea tls_foo@tlsgd(%rip), %rdi
|
|
movabs $__tls_get_addr@pltoff, %rax
|
|
add %rbx, %rax
|
|
call *%rax
|
|
mov (%rax), %eax
|
|
cmp $0x12, %eax
|
|
je 1f
|
|
mov $11, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
lea tls_bar@tlsgd(%rip), %rdi
|
|
movabs $__tls_get_addr@pltoff, %rax
|
|
add %rbx, %rax
|
|
call *%rax
|
|
mov (%rax), %eax
|
|
cmp $0x34, %eax
|
|
je 1f
|
|
mov $12, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# External TLS variable, Local Exec TLS Model (small code model)
|
|
mov %fs:external_tls_var@tpoff, %eax
|
|
cmp $0x56, %eax
|
|
je 1f
|
|
mov $12, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
# External TLS variable, Global Dynamic TLS Model (small code model)
|
|
.byte 0x66
|
|
leaq external_tls_var@tlsgd(%rip), %rdi
|
|
.byte 0x66, 0x66, 0x48
|
|
call __tls_get_addr@plt
|
|
mov (%rax), %eax
|
|
cmp $0x56, %eax
|
|
je 1f
|
|
mov $13, %eax
|
|
jmp 2f
|
|
1:
|
|
|
|
|
|
# Return 0 if all tests are successful
|
|
xor %eax, %eax
|
|
|
|
2:
|
|
pop %rbx
|
|
ret
|
|
|
|
|
|
.section .tdata, "awT", @progbits
|
|
|
|
.global tls_foo
|
|
.type tls_foo, @object
|
|
.size tls_foo, 4
|
|
.align 4
|
|
tls_foo:
|
|
.long 0x12
|
|
|
|
.global tls_bar
|
|
.type tls_bar, @object
|
|
.size tls_bar, 4
|
|
.align 4
|
|
tls_bar:
|
|
.long 0x34
|
|
|
|
#--- external_tls.s
|
|
|
|
.section .tdata, "awT", @progbits
|
|
|
|
.global external_tls_var
|
|
.type external_tls_var, @object
|
|
.size external_tls_var, 4
|
|
.align 4
|
|
external_tls_var:
|
|
.long 0x56
|