Skip to content

Commit 4f281fa

Browse files
committed
[libc] Reset rounding mode after fsetround tests
Differential Revision: https://reviews.llvm.org/D129619
1 parent 880eb83 commit 4f281fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libc/test/src/fenv/rounding_mode_test.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
#include <fenv.h>
1515

1616
TEST(LlvmLibcRoundingModeTest, SetAndGet) {
17+
struct ResetDefaultRoundingMode {
18+
int original;
19+
~ResetDefaultRoundingMode() {
20+
__llvm_libc::fesetround(original);
21+
}
22+
} reset{__llvm_libc::fegetround()};
23+
1724
int s = __llvm_libc::fesetround(FE_TONEAREST);
1825
EXPECT_EQ(s, 0);
1926
int rm = __llvm_libc::fegetround();

0 commit comments

Comments
 (0)