Warray-bounds-36.c: Make functions static to avoid failures with -fpic.
authorMartin Sebor <msebor@redhat.com>
Fri, 23 Aug 2019 15:57:46 +0000 (15:57 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 23 Aug 2019 15:57:46 +0000 (09:57 -0600)
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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Warray-bounds-36.c
gcc/testsuite/gcc.dg/Warray-bounds-41.c

index ad5aa69..2bd6d62 100644 (file)
@@ -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.
index 35b3c92..c47d781 100644 (file)
@@ -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;
index 2ff3692..3b3693f 100644 (file)
@@ -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 *-*-* } } */
 }
-