aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
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
commit07f192e1d7af64d63fd80eafd724b70a18ebfbd9 (patch)
treecb08bbc8783e49cfd8e5e5dec687739df07cac55 /test/Sema/format-strings.c
parent8b76c0dd4abd908781cf69fcf822a1d8bb5532e6 (diff)
add c testcase for string literal diagnostic improvement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index 707873feaf..024e06ab59 100644
--- a/test/Sema/format-strings.c
+++ b/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) {