Files
TheRock/compiler/amd-llvm/lld/test/MachO/arm64-thunk-visibility.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

84 lines
2.2 KiB
ArmAsm

# REQUIRES: aarch64
# foo.s and bar.s both contain TU-local symbols (think static function)
# with the same name, and both need a thunk. This tests that ld64.lld doesn't
# create a duplicate symbol for the two functions.
# Test this both when the TU-local symbol is the branch source or target,
# and for both forward and backwards jumps.
# RUN: rm -rf %t; split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/foo.s -o %t/foo.o
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %t/bar.s -o %t/bar.o
# RUN: %lld -arch arm64 -lSystem -o %t.out %t/foo.o %t/bar.o
#--- foo.s
.subsections_via_symbols
# Note: No .globl, since these are TU-local symbols.
.p2align 2
_early_jumping_local_fn: b _some_late_external
.p2align 2
_early_landing_local_fn: ret
.globl _some_early_external
.p2align 2
_some_early_external: b _late_landing_local_fn
## 0x8000000 is 128 MiB, one more than the forward branch limit.
## Distribute that over two functions since our thunk insertion algorithm
## can't deal with a single function that's 128 MiB.
.global _spacer1, _spacer2
_spacer1:
.space 0x4000000
_spacer2:
.space 0x4000000
# Note: No .globl, since these are TU-local symbols.
.p2align 2
_late_jumping_local_fn: b _some_early_external
.p2align 2
_late_landing_local_fn: ret
.globl _some_late_external
.p2align 2
_some_late_external: b _early_landing_local_fn
#--- bar.s
.subsections_via_symbols
# Note: No .globl, since these are TU-local symbols.
.p2align 2
_early_jumping_local_fn: b _some_other_late_external
.p2align 2
_early_landing_local_fn: ret
.globl _some_other_early_external
.p2align 2
_some_other_early_external: b _late_landing_local_fn
## 0x8000000 is 128 MiB, one more than the forward branch limit.
## Distribute that over two functions since our thunk insertion algorithm
## can't deal with a single function that's 128 MiB.
.global _other_spacer1, _other_spacer1
_spacer1:
.space 0x4000000
_spacer2:
.space 0x4000000
# Note: No .globl, since these are TU-local symbols.
.p2align 2
_late_jumping_local_fn: b _some_other_early_external
.p2align 2
_late_landing_local_fn: ret
.globl _some_other_late_external
.p2align 2
_some_other_late_external: b _early_landing_local_fn
.globl _main
_main:
ret