Analysis: Add support for MS specific printf format specifiers
Summary: Adds support for %I, %I32 and %I64.
Reviewers: hans, jordan_rose, rnk, majnemer
Reviewed By: majnemer
CC: cfe-commits, cdavis5x
Differential Revision: http://llvm-reviews.chandlerc.com/D1456
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188937 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/format-strings-ms.c b/test/Sema/format-strings-ms.c
new file mode 100644
index 0000000..cc574a7
--- /dev/null
+++ b/test/Sema/format-strings-ms.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -fms-compatibility -triple=i386-pc-win32 -pedantic %s
+
+int printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
+
+void test() {
+ short val = 30;
+ printf("val = %I64d\n", val); // expected-warning{{'I64' length modifier is not supported by ISO C}} \
+ // expected-warning{{format specifies type '__int64' (aka 'long long') but the argument has type 'short'}}
+}