Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/pr60598.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/pr60598.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,26 @@ +/* PR target/60598 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-fpic" { target fpic } } */ +/* { dg-additional-options "-march=z196 -mtune=zEC12" { target s390*-*-* } } */ + +struct S { unsigned a, b[32]; }; + +void +foo (struct S *x, struct S *y) +{ + unsigned a = y->a, i; + if (x == y) + for (i = 0; i < a - 1 - i; i++) + { + unsigned t = x->b[i]; + x->b[i] = x->b[a - 1 - i]; + x->b[a - 1 - i] = t; + } + else + { + x->a = a; + for (i = 0; i < a; i++) + x->b[i] = y->b[a - 1 - i]; + } +}