Implement support for the format_arg attribute. Fixes PR4442.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74369 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/attr-format_arg.c b/test/Sema/attr-format_arg.c
new file mode 100644
index 0000000..6f95315
--- /dev/null
+++ b/test/Sema/attr-format_arg.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+const char* f(const char *s) __attribute__((format_arg(1)));
+
+void g(const char *s) {
+  printf("%d", 123);
+  printf("%d %d", 123); // expected-warning{{more '%' conversions than data arguments}}
+
+  printf(f("%d"), 123);
+  printf(f("%d %d"), 123); // expected-warning{{more '%' conversions than data arguments}}
+}