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 buf1[10];
12 
rd(int (& p)[100],int i)13 int rd (int (&p)[100], int i)
14 {
15   int res = p[i];
16   printf ("%d\n", res);
17   return res;
18 }
19 
mpx_test(int argc,const char ** argv)20 int mpx_test (int argc, const char **argv)
21 {
22   int *p;
23 
24   rd (buf, 100);
25 
26   return 0;
27 }
28