aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c
blob: 2512db3965dd44ab95a5b082eafc0fde30dbbc7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* { dg-do run } */
/* { dg-options "-fschedule-insns" { target scheduling } } */

extern void abort (void);

struct S {
    int i;
    int j;
};

struct U {
    struct S s;
} __attribute__((may_alias));

int __attribute__((noinline,noclone))
foo (struct U *p, struct U *q)
{
  int i;
  q->s.j = 1;
  i = p->s.i;
  return i;
}

int main()
{
  int a[3];
  int *p = a;
  p[1] = 0;
  if (foo ((struct U *)(p + 1), (struct U *)p) != 1)
    abort ();
  return 0;
}