aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57303.c
blob: 1ddb5a8aab34634137d03babae41af219b7ea4dc (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
33
/* { dg-do run } */

void abort (void);

struct S0
{
  int f0;
};
struct S1
{
  struct S0 f0;
};

struct S1 x = { {0} };
struct S1 y = { {1} };

static void
foo (struct S0 p)
{
  struct S0 *l = &y.f0;
  *l = x.f0;
  if (p.f0)
    *l = *l;
}

int
main ()
{
  foo(y.f0);
  if (y.f0.f0 != 0)
    abort ();
  return 0;
}