From f7bfd410361b98ad08a41082f6bdd86b3e3ee262 Mon Sep 17 00:00:00 2001 From: Tue Ly Date: Fri, 19 Jul 2024 21:20:46 +0000 Subject: [PATCH] [libc] Temporarily disable hypotf sNaN tests for NVPTX targets. --- libc/test/src/math/smoke/CMakeLists.txt | 2 ++ libc/test/src/math/smoke/HypotTest.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt index 9384df8f5290d..a02648ea1018b 100644 --- a/libc/test/src/math/smoke/CMakeLists.txt +++ b/libc/test/src/math/smoke/CMakeLists.txt @@ -2738,6 +2738,7 @@ add_fp_unittest( DEPENDS libc.src.math.hypotf libc.src.__support.FPUtil.fp_bits + libc.src.__support.macros.properties.architectures ) add_fp_unittest( @@ -2751,6 +2752,7 @@ add_fp_unittest( DEPENDS libc.src.math.hypot libc.src.__support.FPUtil.fp_bits + libc.src.__support.macros.properties.architectures ) add_fp_unittest( diff --git a/libc/test/src/math/smoke/HypotTest.h b/libc/test/src/math/smoke/HypotTest.h index 7921d531a3196..d7c62dcbeb0ed 100644 --- a/libc/test/src/math/smoke/HypotTest.h +++ b/libc/test/src/math/smoke/HypotTest.h @@ -9,6 +9,7 @@ #ifndef LLVM_LIBC_TEST_SRC_MATH_HYPOTTEST_H #define LLVM_LIBC_TEST_SRC_MATH_HYPOTTEST_H +#include "src/__support/macros/properties/architectures.h" #include "test/UnitTest/FPMatcher.h" #include "test/UnitTest/Test.h" @@ -25,8 +26,13 @@ class HypotTestTemplate : public LIBC_NAMESPACE::testing::Test { // Pythagorean triples. constexpr T PYT[N][3] = {{3, 4, 5}, {5, 12, 13}, {8, 15, 17}, {7, 24, 25}}; +#ifndef LIBC_TARGET_ARCH_IS_NVPTX + // TODO: Investigate why sNaN tests are failing on nVidia. + // https://github.com/llvm/llvm-project/issues/99706. EXPECT_FP_EQ(func(inf, sNaN), aNaN); EXPECT_FP_EQ(func(sNaN, neg_inf), aNaN); +#endif // !LIBC_TARGET_ARCH_IS_NVPTX + EXPECT_FP_EQ(func(inf, aNaN), inf); EXPECT_FP_EQ(func(aNaN, neg_inf), inf); EXPECT_FP_EQ(func(aNaN, aNaN), aNaN);