Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / realloc-2-ubv.c
blob36eb90c1abf2755cc8cb6cc22e04e40b7f53f5f2
1 /* { dg-do run } */
2 /* { dg-shouldfail "bounds violation" } */
3 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
6 #define SHOULDFAIL
8 #include "mpx-check.h"
10 int rd (int *p, int i)
12 int res = p[i];
13 printf ("%d\n", res);
14 return res;
17 int mpx_test (int argc, const char **argv)
19 int *buf = (int *)malloc (100 * sizeof(int));
20 buf = (int *)realloc (buf, 10 * sizeof(int));
22 rd (buf, 10);
24 free (buf);
26 return 0;