1 /* { dg-do run } */ 2 /* { dg-shouldfail "bounds violation" } */ 3 /* { dg-require-effective-target ia32 } */ 4 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */ 5 6 7 #define SHOULDFAIL 8 9 #include "mpx-check.h" 10 rd(int * p1,int * p2,int i)11__attribute__((fastcall)) int rd (int *p1, int *p2, int i) 12 { 13 int res = p2[i]; 14 printf ("%d\n", res); 15 return res; 16 } 17 18 int buf[100]; 19 int buf1[10]; 20 mpx_test(int argc,const char ** argv)21int mpx_test (int argc, const char **argv) 22 { 23 rd (buf, buf1, -1); 24 25 return 0; 26 } 27