Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / mpx / field-addr-9-nov.c
blob7f98b0188a3c8551baee2bf0c3f12fb461a3191a
1 /* { dg-do run } */
2 /* { dg-options "-fcheck-pointer-bounds -mmpx" } */
4 /* { dg-additional-options "-fchkp-narrow-to-innermost-array" } */
6 #include "mpx-check.h"
8 struct S {
9 int first;
10 int a[10];
11 int b;
12 } S;
14 struct S1 {
15 int a;
16 struct S b[10];
17 int c;
18 } S1;
20 struct S2 {
21 int x;
22 struct S1 a[10];
23 struct S1 b;
24 } S2;
26 int foo (int *p, int i)
28 int res = p[i];
29 printf ("%d\n", res);
30 return res;
33 struct S2 s1;
34 struct S2 *s2 = &s1;
36 int mpx_test (int argc, const char **argv)
38 foo (&(s2->a[argc].b[5].a[0]), 0);
39 foo (&(s2->a[argc].b[5].a[0]), 9);
41 return 0;