summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-18 18:25:31 +0000
committerChris Lattner <sabre@nondot.org>2009-02-18 18:25:31 +0000
commitdf18c6a9af34550404058f80f9d2e74b42bb4a74 (patch)
tree7ee63ea1b9510c5d69f7d42560b013472b6daca6 /clang
parent2aee77c9062b0ee83a633ecced61b59879c29a73 (diff)
downloadbcm5719-llvm-df18c6a9af34550404058f80f9d2e74b42bb4a74.tar.gz
bcm5719-llvm-df18c6a9af34550404058f80f9d2e74b42bb4a74.zip
add c testcase for string literal diagnostic improvement.
llvm-svn: 64929
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Sema/format-strings.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings.c b/clang/test/Sema/format-strings.c
index 707873feaf8..024e06ab591 100644
--- a/clang/test/Sema/format-strings.c
+++ b/clang/test/Sema/format-strings.c
@@ -29,6 +29,9 @@ void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
vsnprintf(buf,2,global_fmt,ap); // expected-warning {{format string is not a string literal}}
__builtin___vsnprintf_chk(buf,2,0,-1,s,ap); // no-warning
__builtin___vsnprintf_chk(buf,2,0,-1,global_fmt,ap); // expected-warning {{format string is not a string literal}}
+
+ printf("abc"
+ "%*d", (unsigned) 1, 1); // expected-warning {{field width should have type 'int'}}
}
void check_conditional_literal(const char* s, int i) {
OpenPOWER on IntegriCloud