]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/mpx/struct-arg-10-ubv.c
b3b13f86672a7ea821d89d3a7956d95c426af003
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / struct-arg-10-ubv.c
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 struct s1
11 {
12 int *p;
13 } s1;
14
15 int rd (int *p1, int *p2, int *p3, int *p4, int *p5, int *p6, struct s1 s, int i)
16 {
17 int res = s.p[i];
18 printf ("%d\n", res);
19 return res;
20 }
21
22 int buf[100];
23 int buf1[10];
24
25 int mpx_test (int argc, const char **argv)
26 {
27 struct s1 s;
28 s.p = buf;
29
30 rd (buf1, buf1, buf1, buf1, buf1, buf1, s, 100);
31
32 return 0;
33 }