Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / return-pointer-1-nov.c
blob62d05013909a823c256fcb866841e6b11d394f48
1 /* { dg-do run } */
2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
5 #include "mpx-check.h"
7 int *_buf1[100];
8 int _buf2[100];
10 int **get_buf1 ()
12 return _buf1;
15 int *get_buf2 ()
17 return _buf2;
20 void wr (int i, int **buf1, int *buf2)
22 buf1[i] = buf2;
25 int rd (int i, int j, int **buf)
27 int res = buf[i][j];
28 printf ("%d\n", res);
29 return res;
32 int mpx_test (int argc, const char **argv)
34 int **buf1 = get_buf1 ();
35 int *buf2 = get_buf2 ();
36 wr(10, buf1, buf2);
37 rd(10, 0, buf1);
38 rd(10, 99, buf1);
40 return 0;