1 /* { dg-do run } */ 2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */ 3 4 5 #include "mpx-check.h" 6 7 struct S 8 { 9 int a; 10 int p[0]; 11 }; 12 rd(int * p,int i)13int rd (int *p, 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)20int mpx_test (int argc, const char **argv) 21 { 22 struct S *s = (struct S *)alloca (sizeof(struct S) + sizeof (int)*100); 23 rd (s->p, 0); 24 rd (s->p, 99); 25 26 return 0; 27 } 28