test-narrow-macros.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Test code declaring narrowing functions does not conflict with user macros.
  2. Copyright (C) 2018-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. /* The code generating declarations of narrowing functions involves
  16. concatenations of fragments of function names that are not
  17. themselves reserved; thus, it needs to be arranged so that those
  18. fragments are not subject to macro expansion. Verify that
  19. inclusion of <math.h> compiles with such fragments defined as
  20. macros. */
  21. #define f test macro
  22. #define d test macro
  23. #define l test macro
  24. #define f16 test macro
  25. #define f32 test macro
  26. #define f64 test macro
  27. #define f128 test macro
  28. #define f32x test macro
  29. #define f64x test macro
  30. #define f128x test macro
  31. #define add test macro
  32. #define sub test macro
  33. #define mul test macro
  34. #define div test macro
  35. #define dadd test macro
  36. #define dsub test macro
  37. #define dmul test macro
  38. #define ddiv test macro
  39. #define dsqrt test macro
  40. #define dfma test macro
  41. #include <math.h>
  42. static int
  43. do_test (void)
  44. {
  45. /* This is a compilation test. */
  46. return 0;
  47. }
  48. #include <support/test-driver.c>