1 /* { dg-options "-std=c99 -w" } */
2 /* From c_by_val.c in gfortran.dg. */
3 #define _Complex_I (1.0iF)
7 void test_complex_scalars (float _Complex
*float_complex_ptr
,
8 double _Complex
*double_complex_ptr
,
9 long double _Complex
*long_double_complex_ptr
);
10 void test_complex_arrays (float _Complex
*float_complex_array
,
11 double _Complex
*double_complex_array
,
12 long double _Complex
*long_double_complex_array
,
15 int main (int argc
, char **argv
)
19 long double _Complex c3
;
20 float _Complex c1_array
[NUM_ELEMS
];
21 double _Complex c2_array
[NUM_ELEMS
];
22 long double _Complex c3_array
[NUM_ELEMS
];
25 c1
= 1.0 + 0.0 * _Complex_I
;
26 c2
= 2.0 + 0.0 * _Complex_I
;
27 c3
= 3.0 + 0.0 * _Complex_I
;
29 test_complex_scalars (&c1
, &c2
, &c3
);
31 for (i
= 0; i
< NUM_ELEMS
; i
++)
33 c1_array
[i
] = 1.0 * (i
+1) + 0.0 * _Complex_I
;
34 c2_array
[i
] = 1.0 * (i
+1) + 0.0 * _Complex_I
;
35 c3_array
[i
] = 1.0 * (i
+1) + 0.0 * _Complex_I
;
38 test_complex_arrays (c1_array
, c2_array
, c3_array
, NUM_ELEMS
);