]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/mpx/reference-4-lbv.cpp
Daily bump.
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / reference-4-lbv.cpp
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
12 int rd (int (&p)[100], int i)
13 {
14 int res = p[i];
15 printf ("%d\n", res);
16 return res;
17 }
18
19 int (&get_buf ()) [100]
20 {
21 return buf;
22 }
23
24 int mpx_test (int argc, const char **argv)
25 {
26 int *p;
27
28 rd (get_buf (), -1);
29
30 return 0;
31 }