Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / return-struct-4-ubv.c
blob14ba0bddb264e9cca219dacd05d5e1ba047b5e8d
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 struct s1
12 int *p;
13 int i1;
14 int i2;
15 } s1;
17 int buf[100];
19 struct s1 __attribute__((noinline)) get ()
21 struct s1 s;
22 s.p = buf;
23 return s;
26 int __attribute__((noinline)) rd (struct s1 s, int i)
28 int res = s.p[i];
29 printf ("%d\n", res);
30 return res;
33 int mpx_test (int argc, const char **argv)
35 struct s1 s = get ();
37 rd (s, 100);
39 return 0;