1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc-unknown-aix -emit-llvm -target-feature +altivec -target-cpu pwr7 -o - %s | FileCheck %s --check-prefixes=CHECK,AIX32
3 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm -target-feature +altivec -target-cpu pwr7 -o - %s | FileCheck %s --check-prefixes=CHECK,AIX64
5 vector
double vector_varargs(int count
, ...) {
6 __builtin_va_list arg_list
;
7 __builtin_va_start(arg_list
, count
);
11 for (int i
= 0; i
!= count
; ++i
) {
12 ret
= __builtin_va_arg(arg_list
, vector
double);
15 __builtin_va_end(arg_list
);
19 // CHECK: %arg_list = alloca ptr
20 // CHECK: call void @llvm.va_start(ptr %arg_list)
23 // AIX32-NEXT: %argp.cur = load ptr, ptr %arg_list, align 4
24 // AIX32-NEXT: %2 = getelementptr inbounds i8, ptr %argp.cur, i32 15
25 // AIX32-NEXT: %argp.cur.aligned = call ptr @llvm.ptrmask.p0.i32(ptr %2, i32 -16)
26 // AIX32-NEXT: %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i32 16
27 // AIX32-NEXT: store ptr %argp.next, ptr %arg_list, align 4
28 // AIX32-NEXT: %3 = load <2 x double>, ptr %argp.cur.aligned, align 16
29 // AIX32-NEXT: store <2 x double> %3, ptr %ret, align 16
30 // AIX32-NEXT: br label %for.inc
33 // AIX64-NEXT: %argp.cur = load ptr, ptr %arg_list, align 8
34 // AIX64-NEXT: %2 = getelementptr inbounds i8, ptr %argp.cur, i32 15
35 // AIX64-NEXT: %argp.cur.aligned = call ptr @llvm.ptrmask.p0.i64(ptr %2, i64 -16)
36 // AIX64-NEXT: %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i64 16
37 // AIX64-NEXT: store ptr %argp.next, ptr %arg_list, align 8
38 // AIX64-NEXT: %3 = load <2 x double>, ptr %argp.cur.aligned, align 16
39 // AIX64-NEXT: store <2 x double> %3, ptr %ret, align 16
40 // AIX64-NEXT: br label %for.inc
44 // CHECK: call void @llvm.va_end(ptr %arg_list)