Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/AArch64/addr-of-ret-addr.ll
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

83 lines
2.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
; RUN: llc < %s -frame-pointer=all -mtriple=arm64-windows | FileCheck %s
; Test generated from C code:
; #include <stdarg.h>
; ptr foo() {
; return _AddressOfReturnAddress();
; }
; int bar(int x(va_list, ptr), ...) {
; va_list y;
; va_start(y, x);
; return x(y, _AddressOfReturnAddress()) + 1;
; }
declare void @llvm.va_start(ptr)
declare ptr @llvm.addressofreturnaddress()
define dso_local ptr @"foo"() {
; CHECK-LABEL: foo:
; CHECK: .seh_proc foo
; CHECK-NEXT: // %bb.0: // %entry
; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
; CHECK-NEXT: .seh_save_fplr_x 16
; CHECK-NEXT: mov x29, sp
; CHECK-NEXT: .seh_set_fp
; CHECK-NEXT: .seh_endprologue
; CHECK-NEXT: add x0, x29, #8
; CHECK-NEXT: .seh_startepilogue
; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
; CHECK-NEXT: .seh_save_fplr_x 16
; CHECK-NEXT: .seh_endepilogue
; CHECK-NEXT: ret
; CHECK-NEXT: .seh_endfunclet
; CHECK-NEXT: .seh_endproc
entry:
%0 = call ptr @llvm.addressofreturnaddress()
ret ptr %0
}
define dso_local i32 @"bar"(ptr %x, ...) {
; CHECK-LABEL: bar:
; CHECK: .seh_proc bar
; CHECK-NEXT: // %bb.0: // %entry
; CHECK-NEXT: sub sp, sp, #96
; CHECK-NEXT: .seh_stackalloc 96
; CHECK-NEXT: stp x29, x30, [sp, #16] // 16-byte Folded Spill
; CHECK-NEXT: .seh_save_fplr 16
; CHECK-NEXT: add x29, sp, #16
; CHECK-NEXT: .seh_add_fp 16
; CHECK-NEXT: .seh_endprologue
; CHECK-NEXT: add x9, x29, #24
; CHECK-NEXT: mov x8, x0
; CHECK-NEXT: stp x1, x2, [x29, #24]
; CHECK-NEXT: stp x9, x0, [sp]
; CHECK-NEXT: add x0, x29, #24
; CHECK-NEXT: add x1, x29, #8
; CHECK-NEXT: stp x3, x4, [x29, #40]
; CHECK-NEXT: stp x5, x6, [x29, #56]
; CHECK-NEXT: str x7, [x29, #72]
; CHECK-NEXT: blr x8
; CHECK-NEXT: add w0, w0, #1
; CHECK-NEXT: .seh_startepilogue
; CHECK-NEXT: ldp x29, x30, [sp, #16] // 16-byte Folded Reload
; CHECK-NEXT: .seh_save_fplr 16
; CHECK-NEXT: add sp, sp, #96
; CHECK-NEXT: .seh_stackalloc 96
; CHECK-NEXT: .seh_endepilogue
; CHECK-NEXT: ret
; CHECK-NEXT: .seh_endfunclet
; CHECK-NEXT: .seh_endproc
entry:
%x.addr = alloca ptr, align 8
%y = alloca ptr, align 8
store ptr %x, ptr %x.addr, align 8
call void @llvm.va_start(ptr %y)
%0 = load ptr, ptr %x.addr, align 8
%1 = call ptr @llvm.addressofreturnaddress()
%2 = load ptr, ptr %y, align 8
%call = call i32 %0(ptr %2, ptr %1)
%add = add nsw i32 %call, 1
ret i32 %add
}