diff options
Diffstat (limited to 'test/Sema/format-strings-scanf.c')
-rw-r--r-- | test/Sema/format-strings-scanf.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/test/Sema/format-strings-scanf.c b/test/Sema/format-strings-scanf.c index 235ac11faa1c0..d66bed5ffbd63 100644 --- a/test/Sema/format-strings-scanf.c +++ b/test/Sema/format-strings-scanf.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -triple i386-apple-darwin9 -Wformat-nonliteral %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral %s // Test that -Wformat=0 works: // RUN: %clang_cc1 -fsyntax-only -Werror -Wformat=0 %s @@ -107,22 +107,12 @@ void test_alloc_extension(char **sp, wchar_t **lsp, float *fp) { // Test argument type check for the 'm' length modifier. scanf("%ms", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}} - scanf("%mS", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}} + scanf("%mS", fp); // expected-warning-re{{format specifies type 'wchar_t \*\*' \(aka '[^']+'\) but the argument has type 'float \*'}} scanf("%mc", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}} - scanf("%mC", fp); // expected-warning{{format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'}} + scanf("%mC", fp); // expected-warning-re{{format specifies type 'wchar_t \*\*' \(aka '[^']+'\) but the argument has type 'float \*'}} scanf("%m[abc]", fp); // expected-warning{{format specifies type 'char **' but the argument has type 'float *'}} } -void test_longlong(long long *x, unsigned long long *y) { - scanf("%Ld", y); // no-warning - scanf("%Lu", y); // no-warning - scanf("%Lx", y); // no-warning - scanf("%Ld", x); // no-warning - scanf("%Lu", x); // no-warning - scanf("%Lx", x); // no-warning - scanf("%Ls", "hello"); // expected-warning {{length modifier 'L' results in undefined behavior or no effect with 's' conversion specifier}} -} - void test_quad(int *x, long long *llx) { scanf("%qd", x); // expected-warning{{format specifies type 'long long *' but the argument has type 'int *'}} scanf("%qd", llx); // no-warning |