blob: 61c33b052980104ddbfd38e6ed23b2ae59703c4d [file] [log] [blame]
Bill Schmidt61e404e2012-10-04 20:18:38 +00001// REQUIRES: ppc64-registered-target
2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
3
4#include <stdarg.h>
5
6struct x {
7 long a;
8 double b;
9};
10
11void testva (int n, ...)
12{
13 va_list ap;
14
15 struct x t = va_arg (ap, struct x);
Bill Schmidt36450562012-10-04 20:33:57 +000016// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x*
Bill Schmidt61e404e2012-10-04 20:18:38 +000017// CHECK: bitcast %struct.x* %t to i8*
18// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8*
19// CHECK: call void @llvm.memcpy
20
Bill Schmidt61e404e2012-10-04 20:18:38 +000021 int v = va_arg (ap, int);
Bill Schmidt36450562012-10-04 20:33:57 +000022// CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64
Bill Schmidt61e404e2012-10-04 20:18:38 +000023// CHECK: add i64 %{{[0-9]+}}, 4
24// CHECK: inttoptr i64 %{{[0-9]+}} to i8*
25// CHECK: bitcast i8* %{{[0-9]+}} to i32*
Bill Schmidt3b334032012-10-26 20:34:52 +000026
27 __int128_t u = va_arg (ap, __int128_t);
28// CHECK: bitcast i8* %{{[a-z.0-9]+}} to i128*
29// CHECK-NEXT: load i128* %{{[0-9]+}}
Bill Schmidt61e404e2012-10-04 20:18:38 +000030}