summaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-07-17 15:40:56 +0000
commit180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 (patch)
tree2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /test/Sema/format-strings.c
parent29cafa66ad3878dbb9f82615f19fa0bded2e443c (diff)
Notes
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index c78095a04d7b5..b47d3ca2616cf 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -358,3 +358,17 @@ void pr9314() {
printf(__func__); // no-warning
}
+int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
+
+void rdar9612060(void) {
+ printf("%s", 2); // expected-warning{{conversion specifies type 'char *' but the argument has type 'int'}}
+}
+
+void check_char(unsigned char x, signed char y) {
+ printf("%c", y); // no-warning
+ printf("%hhu", x); // no-warning
+ printf("%hhi", y); // no-warning
+ printf("%hhi", x); // no-warning
+ printf("%c", x); // no-warning
+ printf("%hhu", y); // no-warning
+}