summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/format-strings-scanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema/format-strings-scanf.c')
-rw-r--r--clang/test/Sema/format-strings-scanf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/format-strings-scanf.c b/clang/test/Sema/format-strings-scanf.c
index 7a92842b245..ee2be0e6466 100644
--- a/clang/test/Sema/format-strings-scanf.c
+++ b/clang/test/Sema/format-strings-scanf.c
@@ -183,3 +183,11 @@ void check_conditional_literal(char *s, int *i) {
scanf(i ? "%d" : "%d", i, s); // expected-warning{{data argument not used}}
scanf(i ? "%s" : "%d", s); // expected-warning{{format specifies type 'int *'}}
}
+
+void testInvalidNoPrintable(int *a) {
+ scanf("%\u25B9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ scanf("%\xE2\x96\xB9", a); // expected-warning {{invalid conversion specifier '\u25b9'}}
+ scanf("%\U00010348", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ scanf("%\xF0\x90\x8D\x88", a); // expected-warning {{invalid conversion specifier '\U00010348'}}
+ scanf("%\xe2", a); // expected-warning {{invalid conversion specifier '\xe2'}}
+}
OpenPOWER on IntegriCloud