From: Tue Ly Date: Fri, 24 Feb 2023 18:35:52 +0000 (-0500) Subject: [libc][math] Fix floating point exception testing macros in FPMatcher.h for X-Git-Tag: upstream/17.0.6~16542 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=198292f26c17bbc4b9595aca0e9886a6a9806594;p=platform%2Fupstream%2Fllvm.git [libc][math] Fix floating point exception testing macros in FPMatcher.h for aarch64. --- diff --git a/libc/test/UnitTest/FPMatcher.h b/libc/test/UnitTest/FPMatcher.h index 4d2d128..f804b65 100644 --- a/libc/test/UnitTest/FPMatcher.h +++ b/libc/test/UnitTest/FPMatcher.h @@ -124,14 +124,16 @@ FPMatcher getMatcher(T expectedValue) { #define EXPECT_FP_EXCEPTION(expected) \ do { \ if (math_errhandling & MATH_ERREXCEPT) { \ - EXPECT_EQ(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT), expected); \ + EXPECT_GE(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT) & expected, \ + expected); \ } \ } while (0) #define ASSERT_FP_EXCEPTION(expected) \ do { \ if (math_errhandling & MATH_ERREXCEPT) { \ - ASSERT_EQ(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT), expected); \ + ASSERT_GE(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT) & expected, \ + expected); \ } \ } while (0) @@ -140,7 +142,8 @@ FPMatcher getMatcher(T expectedValue) { __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); \ EXPECT_FP_EQ(expected_val, actual_val); \ if (math_errhandling & MATH_ERREXCEPT) { \ - EXPECT_EQ(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT), \ + EXPECT_GE(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT) & \ + expected_except, \ expected_except); \ __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); \ } \ @@ -151,7 +154,8 @@ FPMatcher getMatcher(T expectedValue) { __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); \ EXPECT_FP_IS_NAN(actual_val); \ if (math_errhandling & MATH_ERREXCEPT) { \ - EXPECT_EQ(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT), \ + EXPECT_GE(__llvm_libc::fputil::test_except(FE_ALL_EXCEPT) & \ + expected_except, \ expected_except); \ __llvm_libc::fputil::clear_except(FE_ALL_EXCEPT); \ } \