test-flt-eval-method.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Test evaluation method typedefs match FLT_EVAL_METHOD.
  2. Copyright (C) 2016-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <float.h>
  16. #include <math.h>
  17. #if FLT_EVAL_METHOD == -1
  18. /* Cannot test. */
  19. typedef float_t my_float_t;
  20. typedef double_t my_double_t;
  21. #elif FLT_EVAL_METHOD == 0 || FLT_EVAL_METHOD == 16
  22. typedef float my_float_t;
  23. typedef double my_double_t;
  24. #elif FLT_EVAL_METHOD == 1
  25. typedef double my_float_t;
  26. typedef double my_double_t;
  27. #elif FLT_EVAL_METHOD == 2
  28. typedef long double my_float_t;
  29. typedef long double my_double_t;
  30. #elif FLT_EVAL_METHOD == 32
  31. typedef _Float32 my_float_t;
  32. typedef double my_double_t;
  33. #elif FLT_EVAL_METHOD == 33
  34. typedef _Float32x my_float_t;
  35. typedef _Float32x my_double_t;
  36. #elif FLT_EVAL_METHOD == 64
  37. typedef _Float64 my_float_t;
  38. typedef _Float64 my_double_t;
  39. #elif FLT_EVAL_METHOD == 65
  40. typedef _Float64x my_float_t;
  41. typedef _Float64x my_double_t;
  42. #elif FLT_EVAL_METHOD == 128
  43. typedef _Float128 my_float_t;
  44. typedef _Float128 my_double_t;
  45. #elif FLT_EVAL_METHOD == 129
  46. typedef _Float128x my_float_t;
  47. typedef _Float128x my_double_t;
  48. #else
  49. # error "Unknown FLT_EVAL_METHOD"
  50. #endif
  51. extern float_t test_float_t;
  52. extern my_float_t test_float_t;
  53. extern double_t test_double_t;
  54. extern my_double_t test_double_t;
  55. /* This is a compilation test. */
  56. #define TEST_FUNCTION 0
  57. #include "../test-skeleton.c"