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

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

/* { dg-do run } */

struct X { long x; long y; };

struct X a[1024], b[1024];

void foo ()
{
  for (int i = 0; i < 1024; ++i)
    {
      long tem = a[i].x;
      a[i].x = 0;
      b[i].x = tem;
      b[i].y = a[i].y;
    }
}

int main()
{
  for (int i = 0; i < 1024; ++i)
    a[i].x = i;
  foo ();
  for (int i = 0; i < 1024; ++i)
    if (b[i].x != i)
      __builtin_abort();
  return 0;
}