Files
TheRock/compiler/amd-llvm/clang/test/CodeGen/PowerPC/aix-vaargs.c
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

76 lines
2.9 KiB
C

// REQUIRES: powerpc-registered-target
// REQUIRES: asserts
// RUN: %clang_cc1 -triple powerpc-unknown-aix -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,AIX32
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,AIX64
struct x {
double b;
long a;
};
void testva (int n, ...) {
__builtin_va_list ap;
__builtin_va_start(ap, n);
struct x t = __builtin_va_arg(ap, struct x);
__builtin_va_list ap2;
__builtin_va_copy(ap2, ap);
int v = __builtin_va_arg(ap2, int);
__builtin_va_end(ap2);
__builtin_va_end(ap);
}
// AIX32: define void @testva(i32 noundef %n, ...)
// AIX64: define void @testva(i32 noundef signext %n, ...)
// CHECK-NEXT: entry:
// CHECK-NEXT: %n.addr = alloca i32, align 4
// AIX32-NEXT: %ap = alloca ptr, align 4
// AIX64-NEXT: %ap = alloca ptr, align 8
// CHECK-NEXT: %t = alloca %struct.x, align 8
// AIX32-NEXT: %ap2 = alloca ptr, align 4
// AIX64-NEXT: %ap2 = alloca ptr, align 8
// CHECK-NEXT: %v = alloca i32, align 4
// CHECK-NEXT: store i32 %n, ptr %n.addr, align 4
// CHECK-NEXT: call void @llvm.va_start.p0(ptr %ap)
// AIX32-NEXT: %argp.cur = load ptr, ptr %ap, align 4
// AIX32-NEXT: %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 16
// AIX32-NEXT: store ptr %argp.next, ptr %ap, align 4
// AIX64-NEXT: %argp.cur = load ptr, ptr %ap, align 8
// AIX64-NEXT: %argp.next = getelementptr inbounds i8, ptr %argp.cur, i64 16
// AIX64-NEXT: store ptr %argp.next, ptr %ap, align 8
// AIX32-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 8 %t, ptr align 4 %argp.cur, i32 16, i1 false)
// AIX64-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %t, ptr align 8 %argp.cur, i64 16, i1 false)
// CHECK-NEXT: call void @llvm.va_copy.p0(ptr %ap2, ptr %ap)
// AIX32-NEXT: %argp.cur1 = load ptr, ptr %ap2, align 4
// AIX32-NEXT: %argp.next2 = getelementptr inbounds i8, ptr %argp.cur1, i32 4
// AIX32-NEXT: store ptr %argp.next2, ptr %ap2, align 4
// AIX32-NEXT: %0 = load i32, ptr %argp.cur1, align 4
// AIX32-NEXT: store i32 %0, ptr %v, align 4
// AIX64-NEXT: %argp.cur1 = load ptr, ptr %ap2, align 8
// AIX64-NEXT: %argp.next2 = getelementptr inbounds i8, ptr %argp.cur1, i64 8
// AIX64-NEXT: store ptr %argp.next2, ptr %ap2, align 8
// AIX64-NEXT: %0 = getelementptr inbounds i8, ptr %argp.cur1, i64 4
// AIX64-NEXT: %1 = load i32, ptr %0, align 4
// AIX64-NEXT: store i32 %1, ptr %v, align 4
// CHECK-NEXT: call void @llvm.va_end.p0(ptr %ap2)
// CHECK-NEXT: call void @llvm.va_end.p0(ptr %ap)
// CHECK-NEXT: ret void
// CHECK: declare void @llvm.va_start.p0(ptr)
// AIX32: declare void @llvm.memcpy.p0.p0.i32(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i32, i1 immarg)
// AIX64: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg)
// CHECK: declare void @llvm.va_copy.p0(ptr, ptr)
// CHECK: declare void @llvm.va_end.p0(ptr)