Files
TheRock/compiler/amd-llvm/lld/test/ELF/arm-wraparound-veneer.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

103 lines
3.3 KiB
ArmAsm

// REQUIRES: arm
// RUN: rm -rf %t && split-file %s %t && cd %t
// RUN: llvm-mc -filetype=obj -triple=armv7-none-eabi code.s -o code.o
// RUN: ld.lld -T unsigned1.ld code.o -o unsigned1.elf
// RUN: llvm-objdump --triple=armv7 --no-show-raw-insn -d unsigned1.elf | FileCheck %s --check-prefix=UNSIGNED1
// RUN: ld.lld -T unsigned2.ld code.o -o unsigned2.elf
// RUN: llvm-objdump --triple=armv7 --no-show-raw-insn -d unsigned2.elf | FileCheck %s --check-prefix=UNSIGNED2
// RUN: ld.lld -T signed1.ld code.o -o signed1.elf
// RUN: llvm-objdump --triple=armv7 --no-show-raw-insn -d signed1.elf | FileCheck %s --check-prefix=SIGNED1
// RUN: ld.lld -T signed2.ld code.o -o signed2.elf
// RUN: llvm-objdump --triple=armv7 --no-show-raw-insn -d signed2.elf | FileCheck %s --check-prefix=SIGNED2
/// The aim of this test is to ensure that a BL instruction near one end of the
/// address space can reach a function at the extreme other end, directly,
/// using a branch offset that makes the address wrap round. We check this at
/// both the unsigned wraparound point (one address near 0 and the other near
/// 0xFFFFFFFF) and the signed wraparound point (addresses either side of
/// 0x80000000), crossing the boundary in both directions. In all four cases we
/// expect a direct branch with no veneer.
// UNSIGNED1: Disassembly of section .text.lowaddr:
// UNSIGNED1: <func>:
// UNSIGNED1: 10000: bx lr
//
// UNSIGNED1: Disassembly of section .text.highaddr:
// UNSIGNED1: <_start>:
// UNSIGNED1: ffff0000: bl 0x10000
// UNSIGNED1-NEXT: bx lr
// UNSIGNED2: Disassembly of section .text.lowaddr:
// UNSIGNED2: <_start>:
// UNSIGNED2: 10000: bl 0xffff0000
// UNSIGNED2-NEXT: bx lr
//
// UNSIGNED2: Disassembly of section .text.highaddr:
// UNSIGNED2: <func>:
// UNSIGNED2: ffff0000: bx lr
// SIGNED1: Disassembly of section .text.posaddr:
// SIGNED1: <_start>:
// SIGNED1: 7fff0000: bl 0x80010000
// SIGNED1-NEXT: bx lr
//
// SIGNED1: Disassembly of section .text.negaddr:
// SIGNED1: <func>:
// SIGNED1: 80010000: bx lr
// SIGNED2: Disassembly of section .text.posaddr:
// SIGNED2: <func>:
// SIGNED2: 7fff0000: bx lr
//
// SIGNED2: Disassembly of section .text.negaddr:
// SIGNED2: <_start>:
// SIGNED2: 80010000: bl 0x7fff0000
// SIGNED2-NEXT: bx lr
//--- code.s
.section .text.callee, "ax", %progbits
.global func
.type func, %function
func:
bx lr
.section .text.caller, "ax", %progbits
.global _start
.type _start, %function
_start:
bl func
bx lr
//--- unsigned1.ld
ENTRY(_start)
SECTIONS {
.text.lowaddr 0x00010000 : AT(0x00010000) { *(.text.callee) }
.text.highaddr 0xffff0000 : AT(0xffff0000) { *(.text.caller) }
}
//--- unsigned2.ld
ENTRY(_start)
SECTIONS {
.text.lowaddr 0x00010000 : AT(0x00010000) { *(.text.caller) }
.text.highaddr 0xffff0000 : AT(0xffff0000) { *(.text.callee) }
}
//--- signed1.ld
ENTRY(_start)
SECTIONS {
.text.posaddr 0x7fff0000 : AT(0x7fff0000) { *(.text.caller) }
.text.negaddr 0x80010000 : AT(0x80010000) { *(.text.callee) }
}
//--- signed2.ld
ENTRY(_start)
SECTIONS {
.text.posaddr 0x7fff0000 : AT(0x7fff0000) { *(.text.callee) }
.text.negaddr 0x80010000 : AT(0x80010000) { *(.text.caller) }
}