1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4 
5 
6 #define SHOULDFAIL
7 
8 #include "mpx-check.h"
9 
10 int buf[100];
11 int *p = buf;
12 
foo(int i)13 int foo (int i)
14 {
15   static int **pp = &p;
16 
17   return (*pp)[i];
18 }
19 
mpx_test(int argc,const char * argv[])20 int mpx_test (int argc, const char *argv[])
21 {
22   printf ("%d\n", foo (100));
23 
24   return 0;
25 }
26