Mercurial > hg > CbC > CbC_gcc
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/torture/pr87665.c Thu Oct 25 07:37:49 2018 +0900 @@ -0,0 +1,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; +}