compile_test.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #include <math.h>
  2. static int testf(float float_x, long double long_double_x, /*float complex float_complex_x,*/ int int_x, long long_x)
  3. {
  4. int r = 0;
  5. r += acosf(float_x);
  6. r += acoshf(float_x);
  7. r += asinf(float_x);
  8. r += asinhf(float_x);
  9. r += atan2f(float_x, float_x);
  10. r += atanf(float_x);
  11. r += atanhf(float_x);
  12. /*r += cargf(float_complex_x); - will fight with complex numbers later */
  13. r += cbrtf(float_x);
  14. r += ceilf(float_x);
  15. r += copysignf(float_x, float_x);
  16. r += cosf(float_x);
  17. r += coshf(float_x);
  18. r += erfcf(float_x);
  19. r += erff(float_x);
  20. /*r += exp2f(float_x); - uclibc does not have it (yet?) */
  21. r += expf(float_x);
  22. r += expm1f(float_x);
  23. r += fabsf(float_x);
  24. /*r += fdimf(float_x, float_x); - uclibc does not have it (yet?) */
  25. r += floorf(float_x);
  26. /*r += fmaf(float_x, float_x, float_x); - uclibc does not have it (yet?) */
  27. /*r += fmaxf(float_x, float_x); - uclibc does not have it (yet?) */
  28. /*r += fminf(float_x, float_x); - uclibc does not have it (yet?) */
  29. r += fmodf(float_x, float_x);
  30. r += frexpf(float_x, &int_x);
  31. r += gammaf(float_x);
  32. r += hypotf(float_x, float_x);
  33. r += ilogbf(float_x);
  34. r += ldexpf(float_x, int_x);
  35. r += lgammaf(float_x);
  36. r += llrintf(float_x);
  37. r += llroundf(float_x);
  38. r += log10f(float_x);
  39. r += log1pf(float_x);
  40. /*r += log2f(float_x); - uclibc does not have it (yet?) */
  41. r += logbf(float_x);
  42. r += logf(float_x);
  43. r += lrintf(float_x);
  44. r += lroundf(float_x);
  45. r += modff(float_x, &float_x);
  46. /*r += nearbyintf(float_x); - uclibc does not have it (yet?) */
  47. /*r += nexttowardf(float_x, long_double_x); - uclibc does not have it (yet?) */
  48. r += powf(float_x, float_x);
  49. r += remainderf(float_x, float_x);
  50. /*r += remquof(float_x, float_x, &int_x); - uclibc does not have it (yet?) */
  51. r += rintf(float_x);
  52. r += roundf(float_x);
  53. r += scalbf(float_x, float_x);
  54. /*r += scalblnf(float_x, long_x); - uclibc does not have it (yet?) */
  55. r += scalbnf(float_x, int_x);
  56. r += significandf(float_x);
  57. r += sinf(float_x);
  58. r += sinhf(float_x);
  59. r += sqrtf(float_x);
  60. r += tanf(float_x);
  61. r += tanhf(float_x);
  62. /*r += tgammaf(float_x); - uclibc does not have it (yet?) */
  63. r += truncf(float_x);
  64. return r;
  65. }
  66. static int testl(long double long_double_x, int int_x, long long_x)
  67. {
  68. int r = 0;
  69. r += __finitel(long_double_x);
  70. r += __fpclassifyl(long_double_x);
  71. r += __isinfl(long_double_x);
  72. r += __isnanl(long_double_x);
  73. r += __signbitl(long_double_x);
  74. r += acoshl(long_double_x);
  75. r += acosl(long_double_x);
  76. r += asinhl(long_double_x);
  77. r += asinl(long_double_x);
  78. r += atan2l(long_double_x, long_double_x);
  79. r += atanhl(long_double_x);
  80. r += atanl(long_double_x);
  81. r += cbrtl(long_double_x);
  82. r += ceill(long_double_x);
  83. r += copysignl(long_double_x, long_double_x);
  84. r += coshl(long_double_x);
  85. r += cosl(long_double_x);
  86. r += erfcl(long_double_x);
  87. r += erfl(long_double_x);
  88. r += exp2l(long_double_x);
  89. r += expl(long_double_x);
  90. r += expm1l(long_double_x);
  91. r += fabsl(long_double_x);
  92. r += fdiml(long_double_x, long_double_x);
  93. r += floorl(long_double_x);
  94. r += fmal(long_double_x, long_double_x, long_double_x);
  95. r += fmaxl(long_double_x, long_double_x);
  96. r += fminl(long_double_x, long_double_x);
  97. r += fmodl(long_double_x, long_double_x);
  98. r += frexpl(long_double_x, &int_x);
  99. r += hypotl(long_double_x, long_double_x);
  100. r += ilogbl(long_double_x);
  101. r += ldexpl(long_double_x, int_x);
  102. r += lgammal(long_double_x);
  103. r += llrintl(long_double_x);
  104. r += llroundl(long_double_x);
  105. r += log10l(long_double_x);
  106. r += log1pl(long_double_x);
  107. r += log2l(long_double_x);
  108. r += logbl(long_double_x);
  109. r += logl(long_double_x);
  110. r += lrintl(long_double_x);
  111. r += lroundl(long_double_x);
  112. r += modfl(long_double_x, &long_double_x);
  113. r += nearbyintl(long_double_x);
  114. r += nextafterl(long_double_x, long_double_x);
  115. /* r += nexttowardl(long_double_x, long_double_x); - uclibc doesn't provide this [yet?] */
  116. r += powl(long_double_x, long_double_x);
  117. r += remainderl(long_double_x, long_double_x);
  118. r += remquol(long_double_x, long_double_x, &int_x);
  119. r += rintl(long_double_x);
  120. r += roundl(long_double_x);
  121. r += scalblnl(long_double_x, long_x);
  122. r += scalbnl(long_double_x, int_x);
  123. r += sinhl(long_double_x);
  124. r += sinl(long_double_x);
  125. r += sqrtl(long_double_x);
  126. r += tanhl(long_double_x);
  127. r += tanl(long_double_x);
  128. r += tgammal(long_double_x);
  129. r += truncl(long_double_x);
  130. return r;
  131. }
  132. int main(int argc, char **argv)
  133. {
  134. /* Always 0 but gcc hopefully won't be able to notice */
  135. return 5 & ((long)&testf) & ((long)&testl) & 2;
  136. }