Bill Schmidt | 61e404e | 2012-10-04 20:18:38 +0000 | [diff] [blame] | 1 | // 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 | |
| 6 | struct x { |
| 7 | long a; |
| 8 | double b; |
| 9 | }; |
| 10 | |
| 11 | void testva (int n, ...) |
| 12 | { |
| 13 | va_list ap; |
| 14 | |
| 15 | struct x t = va_arg (ap, struct x); |
Bill Schmidt | 3645056 | 2012-10-04 20:33:57 +0000 | [diff] [blame] | 16 | // CHECK: bitcast i8* %{{[a-z.0-9]*}} to %struct.x* |
Bill Schmidt | 61e404e | 2012-10-04 20:18:38 +0000 | [diff] [blame] | 17 | // CHECK: bitcast %struct.x* %t to i8* |
| 18 | // CHECK: bitcast %struct.x* %{{[0-9]+}} to i8* |
| 19 | // CHECK: call void @llvm.memcpy |
| 20 | |
Bill Schmidt | 61e404e | 2012-10-04 20:18:38 +0000 | [diff] [blame] | 21 | int v = va_arg (ap, int); |
Bill Schmidt | 3645056 | 2012-10-04 20:33:57 +0000 | [diff] [blame] | 22 | // CHECK: ptrtoint i8* %{{[a-z.0-9]*}} to i64 |
Bill Schmidt | 61e404e | 2012-10-04 20:18:38 +0000 | [diff] [blame] | 23 | // CHECK: add i64 %{{[0-9]+}}, 4 |
| 24 | // CHECK: inttoptr i64 %{{[0-9]+}} to i8* |
| 25 | // CHECK: bitcast i8* %{{[0-9]+}} to i32* |
Bill Schmidt | 3b33403 | 2012-10-26 20:34:52 +0000 | [diff] [blame] | 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]+}} |
Bill Schmidt | 61e404e | 2012-10-04 20:18:38 +0000 | [diff] [blame] | 30 | } |