]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/i386/mpx/struct-arg-5-nov.c
a4acd38939efc8b6ec40aa534f6b31a6805a6250
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / struct-arg-5-nov.c
1 /* { dg-do run } */
2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5 #include "mpx-check.h"
6
7 struct s1
8 {
9 int *p;
10 int i1;
11 int i2;
12 } s1;
13
14 int rd (int *p1, int *p2, int *p3, struct s1 s)
15 {
16 int res = s.p[s.i1 + s.i2];
17 printf ("%d\n", res);
18 return res;
19 }
20
21 int buf[100];
22 int buf1[10];
23
24 int mpx_test (int argc, const char **argv)
25 {
26 struct s1 s;
27 s.p = buf;
28 s.i1 = 50;
29 s.i2 = -50;
30
31 rd (buf1, buf1, buf1, s);
32
33 s.i1 = 50;
34 s.i2 = 49;
35
36 rd (buf1, buf1, buf1, s);
37
38 return 0;
39 }