1 /* { dg-do run } */ 2 /* { dg-shouldfail "bounds violation" } */ 3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */ 4 5 6 #define SHOULDFAIL 7 8 #include "mpx-check.h" 9 10 int buf[100]; 11 mpx_test(int argc,const char ** argv)12int mpx_test (int argc, const char **argv) 13 { 14 int *p = __bnd_narrow_ptr_bounds (buf - 10, buf, sizeof (int) * 20); 15 p[20] = argc; 16 return 0; 17 } 18