1 // RUN: %clang_cc1 -Wno-non-pod-varargs -emit-llvm %s -o - -triple=i686-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck %s
7 A(const A
&o
) : a(o
.a
) {}
16 for (int i
= 0; i
< a
.a
; ++i
)
17 sum
+= va_arg(ap
, int);
22 // CHECK-LABEL: define dso_local noundef i32 @"?foo@@YAHUA@@ZZ"(ptr inalloca(<{ %struct.A }>) %0, ...)
25 return foo(A(3), 1, 2, 3);
27 // CHECK-LABEL: define dso_local noundef i32 @main()
28 // CHECK: %[[argmem:[^ ]*]] = alloca inalloca <{ %struct.A, i32, i32, i32 }>
29 // CHECK: call noundef i32 (ptr, ...) @"?foo@@YAHUA@@ZZ"{{.*}}(ptr inalloca(<{ %struct.A, i32, i32, i32 }>) %[[argmem]])
31 void varargs_zero(...);
32 void varargs_one(int, ...);
33 void varargs_two(int, int, ...);
34 void varargs_three(int, int, int, ...);
35 void call_var_args() {
40 varargs_three(1, 2, 3, x
);
43 // CHECK-LABEL: define dso_local void @"?call_var_args@@YAXXZ"()
44 // CHECK: call void {{.*varargs_zero.*}}(ptr inalloca(<{ %struct.A }>) %{{.*}})
45 // CHECK: call void {{.*varargs_one.*}}(ptr inalloca(<{ i32, %struct.A }>) %{{.*}})
46 // CHECK: call void {{.*varargs_two.*}}(ptr inalloca(<{ i32, i32, %struct.A }>) %{{.*}})
47 // CHECK: call void {{.*varargs_three.*}}(ptr inalloca(<{ i32, i32, i32, %struct.A }>) %{{.*}})
49 // CHECK-LABEL: declare dso_local void @"?varargs_zero@@YAXZZ"(...)
50 // CHECK-LABEL: declare dso_local void @"?varargs_one@@YAXHZZ"(i32 noundef, ...)
51 // CHECK-LABEL: declare dso_local void @"?varargs_two@@YAXHHZZ"(i32 noundef, i32 noundef, ...)
52 // CHECK-LABEL: declare dso_local void @"?varargs_three@@YAXHHHZZ"(i32 noundef, i32 noundef, i32 noundef, ...)