1 /* Check -ff2c calling conventions
2 Return value of COMPLEX function is via an extra argument in the
3 calling sequence that points to where to store the return value
4 Additional underscore appended to function name
6 Simplified from f2c output and tested with g77 */
8 /* We used to #include <complex.h>, but this fails for some platforms
9 (like cygwin) who don't have it yet. */
10 #define complex __complex__
11 #define _Complex_I (1.0iF)
14 typedef double doublereal
;
16 extern double f2c_4b__(double *);
17 extern void f2c_4d__( complex float *, complex float *);
18 extern void f2c_4f__( complex float *, int *,complex float *);
19 extern void f2c_4h__( complex double *, complex double *);
20 extern void f2c_4j__( complex double *, int *, complex double *);
21 extern void abort (void);
27 if ( a
!= b
) abort();
31 complex float x
,ret_val
;
32 x
= 1234 + 5678 * _Complex_I
;
33 f2c_4d__(&ret_val
,&x
);
34 if ( x
!= ret_val
) abort();
38 complex float x
,ret_val
;
40 x
= 1234 + 5678 * _Complex_I
;
41 f2c_4f__(&ret_val
,&i
,&x
);
42 if ( x
!= ret_val
) abort();
46 complex double x
,ret_val
;
47 x
= 1234 + 5678.0f
* _Complex_I
;
48 f2c_4h__(&ret_val
,&x
);
49 if ( x
!= ret_val
) abort();
53 complex double x
,ret_val
;
55 x
= 1234.0f
+ 5678.0f
* _Complex_I
;
56 f2c_4j__(&ret_val
,&i
,&x
);
57 if ( x
!= ret_val
) abort();
60 void f2c_4k__(complex float *ret_val
, complex float *x
) {
64 void f2c_4l__(complex float *ret_val
, int *i
, complex float *x
) {
68 void f2c_4m__(complex double *ret_val
, complex double *x
) {
72 void f2c_4n__(complex double *ret_val
, int *i
, complex double *x
) {