view gcc/testsuite/gcc.dg/torture/pr57303.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { 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;
}