Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / union-arg-1-ubv.c
blob6d65e5a73fe28b367ac543dfe2c626f060a8e578
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 union {
13 int i1;
14 int i3;
15 } v;
16 int i2;
17 union {
18 int *p;
19 int p2;
20 } u;
21 } s1;
23 int rd (struct s1 s)
25 int res = s.u.p[s.v.i1 + s.i2];
26 printf ("%d\n", res);
27 return res;
30 int buf[100];
31 int buf1[10];
33 int mpx_test (int argc, const char **argv)
35 struct s1 s;
36 s.u.p = buf;
37 s.v.i1 = 50;
38 s.i2 = 50;
40 rd (s);
42 return 0;