Skip to content

[libc] Temporarily disable hypotf sNaN tests for NVPTX targets. #99708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc/test/src/math/smoke/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
6 changes: 6 additions & 0 deletions libc/test/src/math/smoke/HypotTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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);
Expand Down
Loading