aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-08-23 15:57:46 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-08-23 09:57:46 -0600
commit8e7803e8e11fecfae460e7076ac559f4ba35f2b5 (patch)
tree9367f8bac2ec7a259cc64bd879d90d714dd876e7
parentbf1a58e9be6a6a18b348812be19d965ce0111c7d (diff)
downloadgcc-8e7803e8e11fecfae460e7076ac559f4ba35f2b5.zip
gcc-8e7803e8e11fecfae460e7076ac559f4ba35f2b5.tar.gz
gcc-8e7803e8e11fecfae460e7076ac559f4ba35f2b5.tar.bz2
Warray-bounds-36.c: Make functions static to avoid failures with -fpic.
gcc/testsuite/ChangeLog: * gcc.dg/Warray-bounds-36.c: Make functions static to avoid failures with -fpic. * gcc.dg/Warray-bounds-41.c: Same. From-SVN: r274859
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-36.c6
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-41.c3
3 files changed, 10 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ad5aa69..2bd6d62 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-23 Martin Sebor <msebor@redhat.com>
+
+ * gcc.dg/Warray-bounds-36.c: Make functions static to avoid failures
+ with -fpic.
+ * gcc.dg/Warray-bounds-41.c: Same.
+
2019-08-22 Marek Polacek <polacek@redhat.com>
PR c++/91304 - prefix attributes ignored in condition.
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-36.c b/gcc/testsuite/gcc.dg/Warray-bounds-36.c
index 35b3c92..c47d781 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-36.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-36.c
@@ -3,15 +3,15 @@
{ dg-do compile }
{ dg-options "-O2 -Wall" } */
-int deref (const int *p, int i)
+static int deref (const int *p, int i)
{
- return p[i]; // { dg-warning "array subscript \\\[3, \[0-9\]+] is outside array bounds of .int\\\[2\\\]." "ilp33" { xfail ilp32 } }
+ return p[i]; // { dg-warning "array subscript \\\[3, \[0-9\]+] is outside array bounds of .int\\\[2\\\]." "ilp32" { xfail ilp32 } }
// There should also be an inlining context here. PR 86650 tracks
// its absence.
}
-int deref_3_plus (const int *p, int i)
+static int deref_3_plus (const int *p, int i)
{
if (i < 3)
i = 3;
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-41.c b/gcc/testsuite/gcc.dg/Warray-bounds-41.c
index 2ff3692..3b3693f 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-41.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-41.c
@@ -3,7 +3,7 @@
{ dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */
-void* vptr (void *c)
+static void* vptr (void *c)
{
return c;
}
@@ -31,4 +31,3 @@ void test_vptr_arith_vla_var (int n)
char c[n];
sink (vptr (c) - 1); /* { dg-warning "\\\[-Warray-bounds" "pr82608" { xfail *-*-* } } */
}
-