summaryrefslogtreecommitdiffstats
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Sema/format-strings.c
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index c6dee68..2325454 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -239,6 +239,8 @@ void test_positional_arguments() {
printf("%1$2.2d", (int) 2); // no-warning
printf("%2$*1$.2d", (int) 2, (int) 3); // no-warning
printf("%2$*8$d", (int) 2, (int) 3); // expected-warning{{specified field width is missing a matching 'int' argument}}
+ printf("%%%1$d", (int) 2); // no-warning
+ printf("%1$d%%", (int) 2); // no-warning
}
// PR 6697 - Handle format strings where the data argument is not adjacent to the format string
@@ -284,3 +286,18 @@ void bug7377_bad_length_mod_usage() {
printf("%-0f", 1.23); // expected-warning{{flag '0' is ignored when flag '-' is present}}
printf("%-+f", 1.23); // no-warning
}
+
+// PR 7981 - handle '%lc' (wint_t)
+#ifndef wint_t
+typedef int __darwin_wint_t;
+typedef __darwin_wint_t wint_t;
+#endif
+
+void pr7981(wint_t c, wchar_t c2) {
+ printf("%lc", c); // no-warning
+ printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}}
+ printf("%lc", (char) 1); // no-warning
+ printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *' (aka 'int *')}}
+ printf("%lc", c2); // no-warning
+}
+
OpenPOWER on IntegriCloud