From 083347a3f94282b1baf70c732c5e9d90a42f93cd Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Tue, 16 Jan 2018 22:53:46 +0000 Subject: [PATCH] * c-c++-common/Wrestrict.c (test_strcpy_range): Bump string size of one test and add dg-warning for the -Wstringop-overflow warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256764 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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,5 +1,10 @@ 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): XFAIL last test on SPARC and Visium. 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.11.4.GIT