PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / pr60598.c
blob331e8bde269a5eba27033afd335e8faa684f577c
1 /* PR target/60598 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-additional-options "-fpic" { target fpic } } */
5 /* { dg-additional-options "-march=z196 -mtune=zEC12" { target s390*-*-* } } */
7 struct S { unsigned a, b[32]; };
9 void
10 foo (struct S *x, struct S *y)
12 unsigned a = y->a, i;
13 if (x == y)
14 for (i = 0; i < a - 1 - i; i++)
16 unsigned t = x->b[i];
17 x->b[i] = x->b[a - 1 - i];
18 x->b[a - 1 - i] = t;
20 else
22 x->a = a;
23 for (i = 0; i < a; i++)
24 x->b[i] = y->b[a - 1 - i];