1 /* { dg-do run } */
2 /* { dg-options "-O3 -fno-inline" } */
3
4 #include <stdlib.h>
5
6 typedef struct { double r, i; } complex;
7 #define LEN 30
8 complex c[LEN];
9 double d[LEN];
10
11 void
12 foo (complex *c, double *d, int len1)
13 {
14 int i;
15 for (i = 0; i < len1; i++)
16 {
17 c[i].r = d[i];
18 c[i].i = 0.0;
19 }
20 }
21
22 int
23 main (void)
24 {
25 int i;
26 for (i = 0; i < LEN; i++)
27 d[i] = (double) i;
28 foo (c, d, LEN);
29 for (i=0;i<LEN;i++)
30 if ((c[i].r != (double) i) || (c[i].i != 0.0))
31 abort ();
32 return 0;
33 }
34