summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c
blob: c71486c26c20ab8a483dfa04b2cc86db669a71d5 (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
/* { dg-do run } */

extern void abort (void);

struct X {
    int a;
    struct Y {
	int b[4];
    } b;
    struct Y c;
} m;

struct X n;

foo (int i)
{
  struct Y *p = (i > 10) ? &m.b : &n.c;
  p->b[2] = 10;
  m.b.b[3] = 6;
  n.c.b[2] = 3;
  return p->b[2] + n.c.b[2] + m.b.b[3];
}

main()
{
  if (foo (3) != 12)
    abort ();
  return 0;
}