aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr87665.c
blob: 6f5e968b628474fd114c581bb4356bef476cf828 (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
/* { 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;
}