Skip to content

[flang-rt] Fixed HAVE_LDBL_MANT_DIG_113 detection. #131010

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
Mar 12, 2025
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
11 changes: 0 additions & 11 deletions flang-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,6 @@ elseif (FLANG_RT_GCC_RESOURCE_DIR)
endif ()
endif ()

# Check if 128-bit float computations can be done via long double.
check_cxx_source_compiles(
"#include <cfloat>
#if LDBL_MANT_DIG != 113
#error LDBL_MANT_DIG != 113
#endif
int main() { return 0; }
"
HAVE_LDBL_MANT_DIG_113)


#####################
# Build Preparation #
#####################
Expand Down
8 changes: 6 additions & 2 deletions flang/cmake/modules/FlangCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ if (FLANG_RUNTIME_F128_MATH_LIB)
endif()

# Check if 128-bit float computations can be done via long double
check_cxx_source_compiles(
"#include <cfloat>
# Note that '-nostdinc++' might be implied when this code kicks in
# (see 'runtimes/CMakeLists.txt'), so we cannot use 'cfloat' C++ header
# file in the test below.
# Compile it as C.
check_c_source_compiles(
"#include <float.h>
#if LDBL_MANT_DIG != 113
#error LDBL_MANT_DIG != 113
#endif
Expand Down