break;
case pch::EXPR_VA_ARG:
- // FIXME: untested; we need function bodies first
S = new (Context) VAArgExpr(Empty);
break;
break;
case pch::EXPR_BLOCK_DECL_REF:
- // FIXME: untested until we have statement and block support
S = new (Context) BlockDeclRefExpr(Empty);
break;
}
--- /dev/null
+// Test this without pch.
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h -fsyntax-only -ast-print -o - %s
+
+// Test with pch.
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h &&
+// RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t -fsyntax-only -ast-print -o - %s
+
+char *g0(char** argv, int argc) { return argv[argc]; }
+
+char *g(char **argv) {
+ f(g0, argv, 1, 2, 3);
+}
--- /dev/null
+// Header for PCH test va_arg.c
+
+typedef __builtin_va_list va_list;
+char *f (char * (*g) (char **, int), char **p, ...) {
+ char *s;
+ va_list v;
+ s = g (p, __builtin_va_arg(v, int));
+}