aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/format-strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/format-strings.c')
-rw-r--r--test/Sema/format-strings.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index 16d4943cda..19c29db343 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -31,6 +31,12 @@ void check_string_literal( FILE* fp, const char* s, char *buf, ... ) {
__builtin___vsnprintf_chk(buf,2,0,-1,global_fmt,ap); // expected-warning {{format string is not a string literal}}
}
+void check_conditional_literal(const char* s, int i) {
+ printf(i == 1 ? "yes" : "no"); // no-warning
+ printf(i == 0 ? (i == 1 ? "yes" : "no") : "dont know"); // no-warning
+ printf(i == 0 ? (i == 1 ? s : "no") : "dont know"); // expected-warning
+}
+
void check_writeback_specifier()
{
int x;