Fix for PR5709: use the computed type of the declaration instead of the
type of the builtin when generating the function declaration for a builtin
library call.

llvm-svn: 90936
diff --git a/clang/test/CodeGen/vfprintf.c b/clang/test/CodeGen/vfprintf.c
new file mode 100644
index 0000000..89261c7
--- /dev/null
+++ b/clang/test/CodeGen/vfprintf.c
@@ -0,0 +1,8 @@
+// RUN: clang-cc -emit-llvm-only %s
+
+typedef struct _IO_FILE FILE;
+int vfprintf(FILE*restrict,const char*restrict, __builtin_va_list);
+void foo(__builtin_va_list ap) {
+  vfprintf(0, " ", ap);
+}
+