146 lines · plain
1add_custom_target(libc_fenv_unittests)2 3add_libc_unittest(4 rounding_mode_test5 SUITE6 libc_fenv_unittests7 SRCS8 rounding_mode_test.cpp9 DEPENDS10 libc.src.fenv.fegetround11 libc.src.fenv.fesetround12 LINK_LIBRARIES13 LibcFPTestHelpers14)15 16add_libc_unittest(17 exception_status_test18 SUITE19 libc_fenv_unittests20 SRCS21 exception_status_test.cpp22 DEPENDS23 libc.src.fenv.feclearexcept24 libc.src.fenv.feraiseexcept25 libc.src.fenv.fesetexcept26 libc.src.fenv.fetestexcept27 libc.src.__support.FPUtil.fenv_impl28 LINK_LIBRARIES29 LibcFPTestHelpers30)31 32add_libc_unittest(33 getenv_and_setenv_test34 SUITE35 libc_fenv_unittests36 SRCS37 getenv_and_setenv_test.cpp38 DEPENDS39 libc.src.fenv.fegetenv40 libc.src.fenv.fegetround41 libc.src.fenv.fesetenv42 libc.src.fenv.fesetround43 libc.src.__support.FPUtil.fenv_impl44 libc.src.__support.macros.properties.os45 LINK_LIBRARIES46 LibcFPTestHelpers47)48 49add_libc_unittest(50 exception_flags_test51 SUITE52 libc_fenv_unittests53 SRCS54 exception_flags_test.cpp55 DEPENDS56 libc.src.fenv.fegetexceptflag57 libc.src.fenv.fesetexceptflag58 libc.src.fenv.fetestexceptflag59 libc.src.__support.FPUtil.fenv_impl60 LINK_LIBRARIES61 LibcFPTestHelpers62)63 64add_libc_unittest(65 feupdateenv_test66 SUITE67 libc_fenv_unittests68 SRCS69 feupdateenv_test.cpp70 DEPENDS71 libc.include.signal72 libc.src.fenv.feupdateenv73 libc.src.__support.FPUtil.fenv_impl74 LINK_LIBRARIES75 LibcFPTestHelpers76)77 78add_libc_unittest(79 feclearexcept_test80 SUITE81 libc_fenv_unittests82 SRCS83 feclearexcept_test.cpp84 DEPENDS85 libc.src.fenv.feclearexcept86 libc.src.__support.FPUtil.fenv_impl87 LINK_LIBRARIES88 LibcFPTestHelpers89)90 91add_libc_unittest(92 feenableexcept_test93 SUITE94 libc_fenv_unittests95 SRCS96 feenableexcept_test.cpp97 DEPENDS98 libc.src.fenv.fedisableexcept99 libc.src.fenv.feenableexcept100 libc.src.fenv.fegetexcept101 LINK_LIBRARIES102 LibcFPTestHelpers103)104 105if (NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")106 OR (${LIBC_TARGET_OS} STREQUAL "darwin")))107 # Sanitizers don't like SIGFPE. So, we will run the108 # tests which raise SIGFPE only in non-sanitizer builds.109 # The tests are also disabled for Windows and MacOS as they fail currently.110 # TODO: Investigate and fix the windows failures and enable them for Windows111 # and MacOS.112 add_fp_unittest(113 enabled_exceptions_test114 UNIT_TEST_ONLY115 SUITE116 libc_fenv_unittests117 SRCS118 enabled_exceptions_test.cpp119 DEPENDS120 libc.include.signal121 libc.src.fenv.feclearexcept122 libc.src.fenv.feraiseexcept123 libc.src.fenv.fetestexcept124 libc.src.__support.FPUtil.fenv_impl125 LINK_LIBRARIES126 LibcFPExceptionHelpers127 LibcFPTestHelpers128 )129 130 add_fp_unittest(131 feholdexcept_test132 UNIT_TEST_ONLY133 SUITE134 libc_fenv_unittests135 SRCS136 feholdexcept_test.cpp137 DEPENDS138 libc.hdr.fenv_macros139 libc.src.fenv.feholdexcept140 libc.src.__support.FPUtil.fenv_impl141 LINK_LIBRARIES142 LibcFPExceptionHelpers143 LibcFPTestHelpers144 )145endif()146