From 611ba3ea3300b71eb95dc4e45f20eee5dddd32e1 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 17 Jul 2011 15:40:56 +0000 Subject: Vendor import of clang trunk r135360: http://llvm.org/svn/llvm-project/cfe/trunk@135360 --- test/Sema/format-strings.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/Sema/format-strings.c') diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c index c78095a..b47d3ca 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 +} -- cgit v1.1