aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
blob: ab0014d8f13f3d1bff3b7dcf65a0f5b9206a6a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
extern void abort (void);

static struct X { void *a; void *b; } a, b;

void __attribute__((noinline)) foo (void)
{
  void *tem = a.b;
  a.b = (void *)0;
  b.b = tem;
  b.a = a.a;
  a.a = tem;
}

int main()
{
  a.b = &a;
  foo ();
  if (b.b != &a)
    abort ();
  return 0;
}