Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / reference-4-lbv.cpp
blob2442c6a4a9a094f66a18ec6c94d637bfa6e12540
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
6 #define SHOULDFAIL
8 #include "mpx-check.h"
10 int buf[100];
12 int rd (int (&p)[100], int i)
14 int res = p[i];
15 printf ("%d\n", res);
16 return res;
19 int (&get_buf ()) [100]
21 return buf;
24 int mpx_test (int argc, const char **argv)
26 int *p;
28 rd (get_buf (), -1);
30 return 0;