Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / return-struct-2-ubv.c
blobc5a7ad002af6a038248239f0f13ca756ab1cf2ae
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 *p1;
14 } s1;
16 int buf[100];
17 int buf1[10];
19 struct s1 __attribute__((noinline)) get ()
21 struct s1 s;
22 s.p = buf;
23 s.p1 = buf1;
24 return s;
27 int __attribute__((noinline)) rd (struct s1 s, int i)
29 int res = s.p[i];
30 printf ("%d\n", res);
31 return res;
34 int mpx_test (int argc, const char **argv)
36 struct s1 s = get ();
38 rd (s, 100);
40 return 0;