From a9db08a673d3088d8e60663e2b9643e8ad41b1cf Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 16 Jan 2018 22:53:46 +0000 Subject: [PATCH] Wrestrict.c (test_strcpy_range): Bump string size of one test and add dg-warning for the -Wstringop-overflow warning. * c-c++-common/Wrestrict.c (test_strcpy_range): Bump string size of one test and add dg-warning for the -Wstringop-overflow warning. From-SVN: r256764 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/Wrestrict.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cead046389a..a6933d29b96 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-16 Eric Botcazou + + * c-c++-common/Wrestrict.c (test_strcpy_range): Bump string size of one + test and add dg-warning for the -Wstringop-overflow warning. + 2018-01-16 Eric Botcazou * c-c++-common/Warray-bounds-4.c (test_strcpy_bounds_memarray_range): diff --git a/gcc/testsuite/c-c++-common/Wrestrict.c b/gcc/testsuite/c-c++-common/Wrestrict.c index 671497ea3e6..5fcbbfd169a 100644 --- a/gcc/testsuite/c-c++-common/Wrestrict.c +++ b/gcc/testsuite/c-c++-common/Wrestrict.c @@ -758,7 +758,8 @@ void test_strcpy_range (void) T (8, "012", a + r, a); /* { dg-warning "accessing 4 bytes at offsets \\\[3, \[0-9\]+] and 0 may overlap 1 byte at offset 3" "strcpy" } */ r = SR (DIFF_MAX - 2, DIFF_MAX - 1); - T (8, "012", a + r, a); /* { dg-warning "accessing 4 bytes at offsets \\\[\[0-9\]+, \[0-9\]+] and 0 overlaps" "strcpy" } */ + T (8, "0123", a + r, a); /* { dg-warning "accessing 5 bytes at offsets \\\[\[0-9\]+, \[0-9\]+] and 0 overlaps" "strcpy" } */ + /* { dg-warning "writing 5 bytes into a region of size 0 overflows" "memcpy" { target *-*-* } .-1 } */ /* Exercise the full range of ptrdiff_t. */ r = signed_value (); -- 2.30.2