aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-02 18:44:07 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-02 18:44:07 +0000
commitde45428f923b38d80407dbb9ede0df504256f9f6 (patch)
tree377c10e0c8d15234a4c52b265d4b1e0eb2b81020 /test/Sema/format-strings.c
parenta4275d194b656867bdcdb725b2a7ba3251a1a638 (diff)
Add support for format string checking of object-size checking
versions of sprintf and friends. - Added FIXME that this mechanism should be generalized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index ec070a291b..16d4943cda 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -22,9 +22,13 @@ void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
vasprintf(&b,s,ap); // no-warning
sprintf(buf,s); // expected-warning {{format string is not a string literal}}
snprintf(buf,2,s); // expected-warning {{format string is not a string lit}}
+ __builtin___sprintf_chk(buf,0,-1,s); // expected-warning {{format string is not a string literal}}
+ __builtin___snprintf_chk(buf,2,0,-1,s); // expected-warning {{format string is not a string lit}}
vsprintf(buf,s,ap); // no-warning
vsnprintf(buf,2,s,ap); // no-warning
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}}
}
void check_writeback_specifier()