Make va_arg on x86-64 compute alignment the same way as argument passing.
Fixes <rdar://problem/10463281>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144966 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c
index 8571ac9..ea7dd79 100644
--- a/test/CodeGen/x86_64-arguments.c
+++ b/test/CodeGen/x86_64-arguments.c
@@ -304,3 +304,17 @@
void func43(SA s) {
func42(s);
}
+
+// CHECK: define i32 @f44
+// CHECK: ptrtoint
+// CHECK-NEXT: and {{.*}}, -32
+// CHECK-NEXT: inttoptr
+typedef int T44 __attribute((vector_size(32)));
+struct s44 { T44 x; int y; };
+int f44(int i, ...) {
+ __builtin_va_list ap;
+ __builtin_va_start(ap, i);
+ struct s44 s = __builtin_va_arg(ap, struct s44);
+ __builtin_va_end(ap);
+ return s.y;
+}