1 #define _GNU_SOURCE 2 #include <stdio.h> 3 #include <math.h> 4 #include <complex.h> 5 #include <stdlib.h> 6 7 double complex c1, c2; 8 float complex f1, f2; 9 #ifdef _TEST_LONG_DOUBLE 10 long double complex l1, l2; 11 #endif 12 13 /* 14 * Touch test to make sure all of the expected complex functions exist 15 */ 16 17 int main(void)18main(void) 19 { 20 /* 7.3.5 Trigonometric functions */ 21 /* 7.3.5.1 The cacos functions */ 22 (void) cacos(c1); 23 (void) cacosf(f1); 24 25 /* 7.3.5.2 The casin functions */ 26 (void) casin(c1); 27 (void) casinf(f1); 28 #ifdef _LDBL_EQ_DBL 29 (void) casinl(l1); 30 #endif 31 32 /* 7.3.5.1 The catan functions */ 33 (void) catan(c1); 34 (void) catanf(f1); 35 #ifdef _LDBL_EQ_DBL 36 (void) catanl(l1); 37 #endif 38 39 /* 7.3.5.1 The ccos functions */ 40 (void) ccos(c1); 41 (void) ccosf(f1); 42 43 /* 7.3.5.1 The csin functions */ 44 (void) csin(c1); 45 (void) csinf(f1); 46 47 /* 7.3.5.1 The ctan functions */ 48 (void) ctan(c1); 49 (void) ctanf(f1); 50 51 /* 7.3.6 Hyperbolic functions */ 52 /* 7.3.6.1 The cacosh functions */ 53 (void) cacosh(c1); 54 (void) cacoshf(f1); 55 56 /* 7.3.6.2 The casinh functions */ 57 (void) casinh(c1); 58 (void) casinhf(f1); 59 60 /* 7.3.6.3 The catanh functions */ 61 (void) catanh(c1); 62 (void) catanhf(f1); 63 64 /* 7.3.6.4 The ccosh functions */ 65 (void) ccosh(c1); 66 (void) ccoshf(f1); 67 68 /* 7.3.6.5 The csinh functions */ 69 (void) csinh(c1); 70 (void) csinhf(f1); 71 72 /* 7.3.6.6 The ctanh functions */ 73 (void) ctanh(c1); 74 (void) ctanhf(f1); 75 76 /* 7.3.7 Exponential and logarithmic functions */ 77 /* 7.3.7.1 The cexp functions */ 78 (void) cexp(c1); 79 (void) cexpf(f1); 80 81 /* 7.3.7.2 The clog functions */ 82 (void) clog(c1); 83 (void) clogf(f1); 84 #ifdef _LDBL_EQ_DBL 85 (void) clogl(l1); 86 #endif 87 88 /* 7.3.8 Power and absolute-value functions */ 89 /* 7.3.8.1 The cabs functions */ 90 /*#ifndef __LIBM0_SOURCE__ */ 91 /* avoid conflict with historical cabs(struct complex) */ 92 /* double cabs(c1) __RENAME(__c99_cabs); 93 float cabsf(f1) __RENAME(__c99_cabsf); 94 #endif 95 */ 96 #ifdef _TEST_LONG_DOUBLE 97 (void) cabsl(l1) ; 98 #endif 99 (void) cabs(c1) ; 100 (void) cabsf(f1) ; 101 102 /* 7.3.8.2 The cpow functions */ 103 (void) cpow(c1, c2); 104 (void) cpowf(f1, f2); 105 106 /* 7.3.8.3 The csqrt functions */ 107 (void) csqrt(c1); 108 (void) csqrtf(f1); 109 #ifdef _TEST_LONG_DOUBLE 110 (void) csqrtl(l1); 111 #endif 112 113 /* 7.3.9 Manipulation functions */ 114 /* 7.3.9.1 The carg functions */ 115 (void) carg(c1); 116 (void) cargf(f1); 117 #ifdef _LDBL_EQ_DBL 118 (void) cargl(l1); 119 #endif 120 121 /* 7.3.9.2 The cimag functions */ 122 (void) cimag(c1); 123 (void) cimagf(f1); 124 #ifdef _TEST_LONG_DOUBLE 125 (void) cimagl(l1); 126 #endif 127 128 /* 7.3.9.3 The conj functions */ 129 (void) conj(c1); 130 (void) conjf(f1); 131 132 /* 7.3.9.4 The cproj functions */ 133 (void) cproj(c1); 134 (void) cprojf(f1); 135 136 /* 7.3.9.5 The creal functions */ 137 (void) creal(c1); 138 (void) crealf(f1); 139 #ifdef _TEST_LONG_DOUBLE 140 (void) creall(l1); 141 #endif 142 143 (void) clog10(c1); 144 (void) clog10f(f1); 145 146 #ifdef _LDBL_EQ_DBL 147 (void) cacosl(l1); 148 (void) ccosl(l1); 149 (void) csinl(l1); 150 (void) ctanl(l1); 151 (void) cacoshl(l1); 152 (void) casinhl(l1); 153 (void) catanhl(l1); 154 (void) ccoshl(l1); 155 (void) csinhl(l1); 156 (void) ctanhl(l1); 157 (void) cexpl(l1); 158 (void) cpowl(l1, l2); 159 #endif 160 #ifdef _TEST_LONG_DOUBLE 161 (void) conjl(l1); 162 (void) cprojl(l1); 163 #endif 164 165 return 0; 166 } 167