File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#include " RoundingModeUtils.h"
10
10
11
- #include < fenv.h >
11
+ #include " src/__support/FPUtil/FEnvImpl.h "
12
12
13
13
namespace __llvm_libc {
14
14
namespace fputil {
@@ -34,15 +34,15 @@ int get_fe_rounding(RoundingMode mode) {
34
34
}
35
35
36
36
ForceRoundingMode::ForceRoundingMode (RoundingMode mode) {
37
- old_rounding_mode = fegetround ();
37
+ old_rounding_mode = get_round ();
38
38
rounding_mode = get_fe_rounding (mode);
39
39
if (old_rounding_mode != rounding_mode)
40
- fesetround (rounding_mode);
40
+ set_round (rounding_mode);
41
41
}
42
42
43
43
ForceRoundingMode::~ForceRoundingMode () {
44
44
if (old_rounding_mode != rounding_mode)
45
- fesetround (old_rounding_mode);
45
+ set_round (old_rounding_mode);
46
46
}
47
47
48
48
} // namespace testing
Original file line number Diff line number Diff line change 1
1
function (add_fp_unittest name )
2
2
cmake_parse_arguments (
3
3
"MATH_UNITTEST"
4
- "NEED_MPFR;HERMETIC_TEST_ONLY" # Optional arguments
4
+ "NEED_MPFR;UNIT_TEST_ONLY; HERMETIC_TEST_ONLY" # Optional arguments
5
5
"" # Single value arguments
6
6
"LINK_LIBRARIES" # Multi-value arguments
7
7
${ARGN}
@@ -16,6 +16,8 @@ function(add_fp_unittest name)
16
16
17
17
if (MATH_UNITTEST_HERMETIC_TEST_ONLY )
18
18
set (test_type HERMETIC_TEST_ONLY )
19
+ elseif (MATH_UNITTEST_UNIT_TEST_ONLY )
20
+ set (test_type UNIT_TEST_ONLY )
19
21
endif ()
20
22
if (MATH_UNITTEST_NEED_MPFR )
21
23
if (MATH_UNITTEST_HERMETIC_TEST_ONLY )
@@ -26,7 +28,7 @@ function(add_fp_unittest name)
26
28
endif ()
27
29
list (APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers )
28
30
29
- add_libc_unittest (
31
+ add_libc_test (
30
32
${name}
31
33
${test_type}
32
34
LINK_LIBRARIES "${MATH_UNITTEST_LINK_LIBRARIES} "
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ if (NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")
106
106
libc.src.__support.FPUtil.fenv_impl
107
107
LINK_LIBRARIES
108
108
LibcFPExceptionHelpers
109
+ UNIT_TEST_ONLY
109
110
)
110
111
111
112
add_fp_unittest (
@@ -120,5 +121,6 @@ if (NOT (LLVM_USE_SANITIZER OR (${LIBC_TARGET_OS} STREQUAL "windows")
120
121
libc.src.__support.FPUtil.fenv_impl
121
122
LINK_LIBRARIES
122
123
LibcFPExceptionHelpers
124
+ UNIT_TEST_ONLY
123
125
)
124
126
endif ()
You can’t perform that action at this time.
0 commit comments