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