Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / vla-trailing-1-lbv.c
blob9739920c70506b444a86b4fb165205393dcc348b
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx -fchkp-flexible-struct-trailing-arrays" } */
6 #define SHOULDFAIL
8 #include "mpx-check.h"
10 struct S
12 int a;
13 int p[10];
16 int rd (int *p, int i)
18 int res = p[i];
19 printf ("%d\n", res);
20 return res;
23 int mpx_test (int argc, const char **argv)
25 struct S *s = (struct S *)alloca (sizeof(struct S) + sizeof (int)*100);
26 rd (s->p, -2);
28 return 0;