1/* { dg-do run } */
2/* { dg-options "-fcheck-pointer-bounds -mmpx" } */
3
4
5#include "mpx-check.h"
6
7struct S {
8  int a;
9  int b[100];
10  int c;
11} S;
12
13struct S1 {
14  int x;
15  struct S a[10];
16  struct S b;
17} S1;
18
19int foo (int *p, int i)
20{
21  printf ("%d\n", p[i]);
22  return p[i];
23}
24
25struct S1 s1;
26
27int mpx_test (int argc, const char **argv)
28{
29  foo (&s1.a[9].c, 0);
30  foo (&s1.a[0].a, 0);
31
32  return 0;
33}
34