From: Martin Sebor Date: Sat, 11 Mar 2017 00:33:45 +0000 (+0000) Subject: As discussed in https://gcc.gnu.org/ml/gcc-patches/2017-02/msg00942.html X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66b275452317666162076415d2112e5404946f72;p=gcc.git As discussed in https://gcc.gnu.org/ml/gcc-patches/2017-02/msg00942.html gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Add a test case. From-SVN: r246064 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4453fbbae8b..84978902888 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-03-10 Martin Sebor + + * gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Add a test case. + 2017-03-10 Bernd Schmidt PR rtl-optimization/78911 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c index c4f7e1f5d22..d7d931716ce 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c @@ -200,6 +200,10 @@ void test_sprintf_chk_range_schar (void) T ( 0, "%hhi", R (1024, 2035)); /* { dg-warning ".%hhi. directive writing between 1 and 4 bytes into a region of size 0" } */ /* { dg-message "using the range \\\[-128, 127\\\] for directive argument" "note" { target *-*-* } .-1 } */ + T ( 2, "%#hhx", R (1234, 12345)); /* { dg-warning "'%#hhx' directive writing between 1 and 4 bytes into a region of size 2 " } */ + T ( 3, "%#hhx", R (1234, 12345)); /* { dg-warning "may write a terminating nul" } */ + T ( 4, "%#hhx", R (1234, 12345)); + #undef R #define R(min, max) range_schar (min, max)