1// REQUIRES: powerpc-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);
16// CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x*
17// CHECK: bitcast %struct.x* %t to i8*
18// CHECK: bitcast %struct.x* %{{[0-9]+}} to i8*
19// CHECK: call void @llvm.memcpy
20
21  int v = va_arg (ap, int);
22// CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64
23// CHECK: add i64 %{{[0-9]+}}, 4
24// CHECK: inttoptr i64 %{{[0-9]+}} to i8*
25// CHECK: bitcast i8* %{{[0-9]+}} to i32*
26
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]+}}
30}
31