aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-01-16 22:53:46 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-01-16 22:53:46 +0000
commita9db08a673d3088d8e60663e2b9643e8ad41b1cf (patch)
tree39039514c0777c3a4cdbd6aac8c75b7fcf8a443b
parent6702f18b27cb032588a8086046d0e1b65d7b534c (diff)
downloadgcc-a9db08a673d3088d8e60663e2b9643e8ad41b1cf.zip
gcc-a9db08a673d3088d8e60663e2b9643e8ad41b1cf.tar.gz
gcc-a9db08a673d3088d8e60663e2b9643e8ad41b1cf.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/c-c++-common/Wrestrict.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cead046..a6933d2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2018-01-16 Eric Botcazou <ebotcazou@adacore.com>
+ * 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 <ebotcazou@adacore.com>
+
* 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 671497e..5fcbbfd 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 ();