argument to __builtin_va_arg. Patch by Rahul Jain, some test massaging and
IR emission order changes by me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206223
91177308-0d34-0410-b5e6-
96231b3b80d8
}
Value *ScalarExprEmitter::VisitVAArgExpr(VAArgExpr *VE) {
+ QualType Ty = VE->getType();
+ if (Ty->isVariablyModifiedType())
+ CGF.EmitVariablyModifiedType(Ty);
+
llvm::Value *ArgValue = CGF.EmitVAListRef(VE->getSubExpr());
llvm::Value *ArgPtr = CGF.EmitVAArg(ArgValue, VE->getType());
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
-
+// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
// PR6433 - Don't crash on va_arg(typedef).
typedef double gdouble;
// CHECK-NOT: llvm.trap
vararg(0, focus_changed_cb);
}
+
+void vla(int n, ...)
+{
+ __builtin_va_list ap;
+ void *p;
+ p = __builtin_va_arg(ap, typeof (int (*)[++n])); // CHECK: add nsw i32 {{.*}}, 1
+}