Commit 8e7803e8 by Martin Sebor Committed by Martin Sebor

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
parent bf1a58e9
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> 2019-08-22 Marek Polacek <polacek@redhat.com>
PR c++/91304 - prefix attributes ignored in condition. PR c++/91304 - prefix attributes ignored in condition.
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
{ dg-do compile } { dg-do compile }
{ dg-options "-O2 -Wall" } */ { 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 // There should also be an inlining context here. PR 86650 tracks
// its absence. // its absence.
} }
int deref_3_plus (const int *p, int i) static int deref_3_plus (const int *p, int i)
{ {
if (i < 3) if (i < 3)
i = 3; i = 3;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{ dg-require-effective-target alloca } { dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */ { dg-options "-O2 -Wall" } */
void* vptr (void *c) static void* vptr (void *c)
{ {
return c; return c;
} }
...@@ -31,4 +31,3 @@ void test_vptr_arith_vla_var (int n) ...@@ -31,4 +31,3 @@ void test_vptr_arith_vla_var (int n)
char c[n]; char c[n];
sink (vptr (c) - 1); /* { dg-warning "\\\[-Warray-bounds" "pr82608" { xfail *-*-* } } */ sink (vptr (c) - 1); /* { dg-warning "\\\[-Warray-bounds" "pr82608" { xfail *-*-* } } */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment