fix format specifier fixit for printf("%ld", "foo");
It should reset the length modifier (unless it's a wchar_t string).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146252 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/format-strings-fixit.c b/test/Sema/format-strings-fixit.c
index e87d8ac..bfb5432 100644
--- a/test/Sema/format-strings-fixit.c
+++ b/test/Sema/format-strings-fixit.c
@@ -42,7 +42,7 @@
// Bad length modifiers
printf("%hhs", "foo");
printf("%1$zp", (void *)0);
-
+
// Perserve the original formatting for unsigned integers.
unsigned long val = 42;
printf("%X", val);
@@ -57,6 +57,9 @@
printf("%f", (intmax_t) 42);
printf("%f", (uintmax_t) 42);
printf("%f", (ptrdiff_t) 42);
+
+ // string
+ printf("%ld", "foo");
}
// Validate the fixes...
@@ -83,3 +86,4 @@
// CHECK: printf("%jd", (intmax_t) 42);
// CHECK: printf("%ju", (uintmax_t) 42);
// CHECK: printf("%td", (ptrdiff_t) 42);
+// CHECK: printf("%s", "foo");