PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / gcc.dg / pr45652.c
blob74e284ca4a10717b11887443ed752dfa9aac5406
1 /* { dg-do run { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -fselective-scheduling2" } */
4 struct S {
5 double i[2];
6 };
8 void __attribute__ ((noinline)) checkcd (struct S x)
10 if (x.i[0] != 7.0 || x.i[1] != 8.0)
11 __builtin_abort ();
14 void __attribute__ ((noinline)) testvacd (int n, ...)
16 int i;
17 __builtin_va_list ap;
18 __builtin_va_start (ap, n);
19 for (i = 0; i < n; i++)
21 struct S t = __builtin_va_arg (ap, struct S);
22 checkcd (t);
24 __builtin_va_end (ap);
27 void
28 testitcd (void)
30 struct S x = { { 7.0, 8.0 } };
31 testvacd (2, x, x);
34 int
35 main ()
37 testitcd ();
38 return 0;