[clang] [flang] [llvm] [flang] Use backend fp128 support to determine REAL(16) availability (PR #221907)
Shunsuke Watanabe via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 26 01:14:33 PST 2026
https://github.com/s-watanabe314 updated https://github.com/llvm/llvm-project/pull/221907
>From c0eeeefdf08ac1b625c081b6fd37d19847d3252c Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Mon, 31 Aug 2026 11:53:36 +0900
Subject: [PATCH 01/11] [flang] Use backend fp128 support to determine REAL(16)
availability
The existing REAL(16) availability checks depend on build-time math
library or long double support. This does not fully represent the
capabilities of a compilation target, particularly when
cross-compiling.
In addition to the existing checks, query the target's TargetLowering
information and enable REAL(16) when fp128 is a legal backend value
type. This enables the frontend to compile REAL(16) for targets such
as x86_64 and AArch64 independently of REAL(16) math intrinsic library
support.
The runtimes build cannot directly reuse the frontend's TargetLowering
query during CMake configuration. Enable the REAL(16) intrinsic modules
for x86_64 and AArch64 runtime targets, while preserving the existing
checks for an external F128 math library and LDBL_MANT_DIG == 113.
Pass the resulting setting separately to each runtime sub-build.
Update the affected tests to detect REAL(16) frontend support by
invoking the Flang driver for the configured target. Also document
that backend fp128 type support and REAL(16) math intrinsic library
support are independent.
Discussion:
https://discourse.llvm.org/t/cross-compilation-of-real-kind-16/89161
https://github.com/llvm/llvm-project/pull/182230
---
flang/docs/Real16MathSupport.md | 39 +++++++++++++++++++++
flang/include/flang/Tools/TargetSetup.h | 29 ++++++++++++++-
flang/test/Lower/HLFIR/convert-variable.f90 | 2 +-
flang/test/Lower/Intrinsics/abs.f90 | 2 +-
flang/test/Lower/Intrinsics/modulo.f90 | 2 +-
flang/test/Lower/Intrinsics/sign.f90 | 2 +-
flang/test/Lower/assignment.f90 | 2 +-
flang/test/Lower/math-lowering/abs.f90 | 12 +++----
flang/test/lit.cfg.py | 22 ++++++++++++
flang/test/lit.site.cfg.py.in | 1 +
llvm/runtimes/CMakeLists.txt | 36 +++++++++++++++----
11 files changed, 130 insertions(+), 19 deletions(-)
diff --git a/flang/docs/Real16MathSupport.md b/flang/docs/Real16MathSupport.md
index 93492c8b767c39..42695d0248adce 100644
--- a/flang/docs/Real16MathSupport.md
+++ b/flang/docs/Real16MathSupport.md
@@ -36,3 +36,42 @@ may provide `REAL(16)` math support without a `libquadmath`
dependency, using standard `libc` APIs for the `long double`
data type. It is not recommended to use the above CMake option
for building Flang compilers for such targets.
+
+In addition to the runtime library support described above, Flang may
+also consider `REAL(16)` available when the LLVM backend supports the
+target's 128-bit floating-point type. This check is independent of the
+availability of libraries implementing `REAL(16)` math intrinsics.
+
+As a result, `REAL(16)` variables and arithmetic operations may be accepted
+even when no library support for `REAL(16)` math intrinsics is available.
+In such cases, references to math intrinsic functions can result in linker
+errors rather than frontend diagnostics. For example:
+
+```
+FIRModule:(.text+0x97): undefined reference to `_FortranASinF128'
+```
+
+In such configurations, basic arithmetic operations such as addition,
+subtraction, multiplication, and division may still work if they are
+supported by the LLVM backend, while math intrinsics such as SIN, COS, EXP,
+and LOG require additional runtime library support.
+
+This distinction can affect programs that use `SELECTED_REAL_KIND` to
+determine whether `REAL(16)` is available. For example:
+
+```Fortran
+function test(x)
+ integer, parameter :: k = merge(16, 4, selected_real_kind(p=33) .eq. 16)
+ real(kind=k) :: x
+ test = sin(x)
+end function
+```
+
+When `SELECTED_REAL_KIND(p=33)` is evaluated during constant folding, it may
+produce `16` if `REAL(16)` type support is available, even when the
+corresponding math intrinsic library support is unavailable. In such cases
+the program may compile successfully but fail to link because the required
+`REAL(16)` math intrinsic implementations cannot be found.
+
+Users who want to prevent any use of `REAL(16)` regardless of backend
+support can use the `-fdisable-real-16` option.
diff --git a/flang/include/flang/Tools/TargetSetup.h b/flang/include/flang/Tools/TargetSetup.h
index 47f886141b002a..03a0acda3fb518 100644
--- a/flang/include/flang/Tools/TargetSetup.h
+++ b/flang/include/flang/Tools/TargetSetup.h
@@ -12,6 +12,10 @@
#include "flang/Common/float128.h"
#include "flang/Evaluate/target.h"
#include "flang/Frontend/TargetOptions.h"
+#include "llvm/CodeGen/TargetLowering.h"
+#include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
namespace Fortran::tools {
@@ -67,7 +71,30 @@ namespace Fortran::tools {
constexpr bool f128Support = false;
#endif
- if constexpr (!f128Support) {
+ bool f128BESupport = false;
+ llvm::LLVMContext ctx;
+ std::unique_ptr<llvm::Module> dummyModule =
+ std::make_unique<llvm::Module>("quad-test", ctx);
+ dummyModule->setTargetTriple(targetMachine.getTargetTriple());
+ dummyModule->setDataLayout(targetMachine.createDataLayout());
+
+ llvm::FunctionType *dummyFTy =
+ llvm::FunctionType::get(llvm::Type::getVoidTy(ctx), false);
+ llvm::Function *dummyF = llvm::Function::Create(dummyFTy,
+ llvm::GlobalValue::ExternalLinkage, "quad-test", dummyModule.get());
+
+ const llvm::TargetLowering *dummyTLI =
+ targetMachine.getSubtargetImpl(*dummyF)->getTargetLowering();
+
+ if (dummyTLI) {
+ llvm::EVT fp128EVT = llvm::EVT::getEVT(llvm::Type::getFP128Ty(ctx));
+
+ // Query for fp128 backend support. Based on this, determine whether
+ // compilation is possible on the frontend.
+ f128BESupport = dummyTLI->isTypeLegal(fp128EVT);
+ }
+
+ if (!f128Support && !f128BESupport) {
targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 16);
targetCharacteristics.DisableType(
Fortran::common::TypeCategory::Complex, 16);
diff --git a/flang/test/Lower/HLFIR/convert-variable.f90 b/flang/test/Lower/HLFIR/convert-variable.f90
index b9fda640182d4d..eb5d307676afcb 100644
--- a/flang/test/Lower/HLFIR/convert-variable.f90
+++ b/flang/test/Lower/HLFIR/convert-variable.f90
@@ -1,5 +1,5 @@
! Test lowering of variables to fir.declare
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
subroutine scalar_numeric(x)
integer :: x
diff --git a/flang/test/Lower/Intrinsics/abs.f90 b/flang/test/Lower/Intrinsics/abs.f90
index 97c58631a13297..44046fa05f0019 100644
--- a/flang/test/Lower/Intrinsics/abs.f90
+++ b/flang/test/Lower/Intrinsics/abs.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-supports-f128-math %{F128%} %else %{F64%}
+! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
! RUN: %flang_fc1 -emit-hlfir -mllvm --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-PRECISE"
! RUN: %flang_fc1 -emit-hlfir -mllvm --force-mlir-complex %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-FAST"
! RUN: %flang_fc1 -fapprox-func -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-APPROX"
diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90
index 0cb91f3862f202..4512bc3c75640e 100644
--- a/flang/test/Lower/Intrinsics/modulo.f90
+++ b/flang/test/Lower/Intrinsics/modulo.f90
@@ -1,5 +1,5 @@
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL
-! RUN: %flang_fc1 -menable-no-infs -emit-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-supports-f128-math %{F128%} %else %{F64%}
+! RUN: %flang_fc1 -menable-no-infs -emit-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
! ALL-LABEL: func @_QPmodulo_testr(
! ALL-SAME: %[[arg0:.*]]: !fir.ref<f64>{{.*}}, %[[arg1:.*]]: !fir.ref<f64>{{.*}}, %[[arg2:.*]]: !fir.ref<f64>{{.*}}) {
diff --git a/flang/test/Lower/Intrinsics/sign.f90 b/flang/test/Lower/Intrinsics/sign.f90
index 965bda3d5b8341..19d5d67fd32328 100644
--- a/flang/test/Lower/Intrinsics/sign.f90
+++ b/flang/test/Lower/Intrinsics/sign.f90
@@ -1,4 +1,4 @@
-! RUN: bbc %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}
+! RUN: bbc %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
! CHECK-LABEL: sign_testi
subroutine sign_testi(a, b, c)
diff --git a/flang/test/Lower/assignment.f90 b/flang/test/Lower/assignment.f90
index f8bef3e99c5958..91c11aa345ed04 100644
--- a/flang/test/Lower/assignment.f90
+++ b/flang/test/Lower/assignment.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 %s -o "-" -emit-hlfir -cpp | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}%if target=x86_64-unknown-linux{{.*}} %{,CHECK-X86-64%}
+! RUN: %flang_fc1 %s -o "-" -emit-hlfir -cpp | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}%if target=x86_64-unknown-linux{{.*}} %{,CHECK-X86-64%}
subroutine sub1(a)
integer :: a
diff --git a/flang/test/Lower/math-lowering/abs.f90 b/flang/test/Lower/math-lowering/abs.f90
index 9d3b8b92cfdd60..a7e00715a9e751 100644
--- a/flang/test/Lower/math-lowering/abs.f90
+++ b/flang/test/Lower/math-lowering/abs.f90
@@ -1,9 +1,9 @@
-! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST,FAST-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
-! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
-! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST,FAST-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
function test_real4(x)
real :: x, test_real4
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index e7aa50e001b929..d3fabb57ae77cc 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -265,11 +265,33 @@ def get_resource_module_intrinsic_dir(modfile):
config.substitutions.append(("%openmp_flags", "-fopenmp"))
+def flang_supports_f128():
+ flang_exe = lit.util.which("flang", config.clang_tools_dir)
+
+ if not flang_exe:
+ return False
+
+ try:
+ testcode = b"real(16) :: x\nend"
+ flang_cmd = subprocess.run(
+ [flang_exe, "--target=" + config.target_triple, "-fsyntax-only", "-"],
+ input=testcode,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ except OSError:
+ return False
+
+ if flang_cmd.returncode == 0:
+ return True
+
# Add features and substitutions to test F128 math support.
# %f128-lib substitution may be used to generate check prefixes
# for LIT tests checking for F128 library support.
if config.flang_runtime_f128_math_lib or config.have_ldbl_mant_dig_113:
config.available_features.add("flang-supports-f128-math")
+if flang_supports_f128():
+ config.available_features.add("flang-frontend-supports-f128")
if config.flang_runtime_f128_math_lib:
config.available_features.add(
"flang-f128-math-lib-" + config.flang_runtime_f128_math_lib
diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in
index ca94ef41533901..2a9c6735e9f196 100644
--- a/flang/test/lit.site.cfg.py.in
+++ b/flang/test/lit.site.cfg.py.in
@@ -12,6 +12,7 @@ config.llvm_target_triple_env = "@LLVM_TARGET_TRIPLE_ENV@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
config.flang_obj_root = path(r"@FLANG_BINARY_DIR@")
+config.clang_tools_dir = lit_config.substitute(path(r"@CURRENT_TOOLS_DIR@"))
config.flang_tools_dir = lit_config.substitute("@FLANG_TOOLS_DIR@")
config.flang_headers_dir = "@HEADER_BINARY_DIR@"
config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 9bc0196b4262c2..3f19fd31f1a65b 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -525,6 +525,17 @@ function(runtime_register_target name)
add_flang_mod_deps(runtimes-${name}-build ${${name}_extra_targets})
endfunction()
+# Determine whether REAL(16) intrinsic modules should be built for the target.
+function(check_real16_support target result)
+ if(FLANG_RUNTIME_F128_MATH_LIB
+ OR HAVE_LDBL_MANT_DIG_113
+ OR target MATCHES "^(x86_64|aarch64)")
+ set(${result} TRUE PARENT_SCOPE)
+ else()
+ set(${result} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
# Check if we have any runtimes to build.
if(runtimes)
set(build_runtimes TRUE)
@@ -671,18 +682,29 @@ if(build_runtimes)
if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES OR "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
list(APPEND extra_args ENABLE_FORTRAN)
endif()
- # Ensure REAL(16) support in runtimes to be consistent with compiler
- if(FLANG_RUNTIME_F128_MATH_LIB OR HAVE_LDBL_MANT_DIG_113)
- list(APPEND extra_cmake_args "-DFORTRAN_SUPPORTS_REAL16=1")
+ # Ensure REAL(16) support in runtimes to be consistent with compiler.
+ # Keep intrinsic module generation consistent with targets for which
+ # the Flang frontend currently enables REAL(16) through backend support.
+ if(LLVM_RUNTIME_TARGETS)
+ foreach(name ${LLVM_RUNTIME_TARGETS})
+ if(name STREQUAL "default")
+ check_real16_support("${LLVM_TARGET_TRIPLE}" supports_real16)
+ set(default_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
+ else()
+ check_real16_support("${name}" supports_real16)
+ set(${name}_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
+ endif()
+ endforeach()
else()
- list(APPEND extra_cmake_args "-DFORTRAN_SUPPORTS_REAL16=0")
+ check_real16_support("${LLVM_TARGET_TRIPLE}" supports_real16)
+ set(default_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
endif()
endif()
if(NOT LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
- CMAKE_ARGS ${extra_cmake_args}
+ CMAKE_ARGS ${extra_cmake_args} ${default_fortran_cmake_args}
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
set(test_targets check-runtimes)
@@ -690,7 +712,7 @@ if(build_runtimes)
if("default" IN_LIST LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
- CMAKE_ARGS ${extra_cmake_args}
+ CMAKE_ARGS ${extra_cmake_args} ${default_fortran_cmake_args}
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
@@ -749,7 +771,7 @@ if(build_runtimes)
runtime_register_target(${name}
DEPENDS ${builtins_dep_name} ${extra_deps}
- CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
+ CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args} ${${name}_fortran_cmake_args}
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
endforeach()
>From 1c2d53a93229f784665b96a4166a6b89a99b1de7 Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Tue, 8 Sep 2026 18:20:27 +0900
Subject: [PATCH 02/11] fix python format
---
flang/test/lit.cfg.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index d3fabb57ae77cc..bd12c935ee1e0c 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -265,6 +265,7 @@ def get_resource_module_intrinsic_dir(modfile):
config.substitutions.append(("%openmp_flags", "-fopenmp"))
+
def flang_supports_f128():
flang_exe = lit.util.which("flang", config.clang_tools_dir)
@@ -285,6 +286,7 @@ def flang_supports_f128():
if flang_cmd.returncode == 0:
return True
+
# Add features and substitutions to test F128 math support.
# %f128-lib substitution may be used to generate check prefixes
# for LIT tests checking for F128 library support.
>From 291ba74bd8800860afd6bfacb38754c1c86d70fb Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Wed, 9 Sep 2026 13:31:30 +0900
Subject: [PATCH 03/11] fix python function name
---
flang/test/lit.cfg.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index bd12c935ee1e0c..f02d92d3a99487 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -266,7 +266,7 @@ def get_resource_module_intrinsic_dir(modfile):
config.substitutions.append(("%openmp_flags", "-fopenmp"))
-def flang_supports_f128():
+def flang_frontend_supports_f128():
flang_exe = lit.util.which("flang", config.clang_tools_dir)
if not flang_exe:
@@ -292,7 +292,7 @@ def flang_supports_f128():
# for LIT tests checking for F128 library support.
if config.flang_runtime_f128_math_lib or config.have_ldbl_mant_dig_113:
config.available_features.add("flang-supports-f128-math")
-if flang_supports_f128():
+if flang_frontend_supports_f128():
config.available_features.add("flang-frontend-supports-f128")
if config.flang_runtime_f128_math_lib:
config.available_features.add(
>From 251d9466172d914855439fbea65d834b84403eab Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Wed, 9 Sep 2026 13:34:24 +0900
Subject: [PATCH 04/11] update docs
---
flang/docs/Real16MathSupport.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/flang/docs/Real16MathSupport.md b/flang/docs/Real16MathSupport.md
index 42695d0248adce..d1005829461e1d 100644
--- a/flang/docs/Real16MathSupport.md
+++ b/flang/docs/Real16MathSupport.md
@@ -53,8 +53,8 @@ FIRModule:(.text+0x97): undefined reference to `_FortranASinF128'
In such configurations, basic arithmetic operations such as addition,
subtraction, multiplication, and division may still work if they are
-supported by the LLVM backend, while math intrinsics such as SIN, COS, EXP,
-and LOG require additional runtime library support.
+supported by the LLVM backend, while math intrinsics such as `SIN`, `COS`, `EXP`,
+and `LOG` will require additional runtime library support.
This distinction can affect programs that use `SELECTED_REAL_KIND` to
determine whether `REAL(16)` is available. For example:
>From eb8b00ad4e13bab1de089480063aedc806f755fd Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Wed, 9 Sep 2026 13:48:15 +0900
Subject: [PATCH 05/11] use config.flang_exe
---
flang/test/lit.cfg.py | 7 +------
flang/test/lit.site.cfg.py.in | 1 -
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index f02d92d3a99487..d7d6178f0e8855 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -267,15 +267,10 @@ def get_resource_module_intrinsic_dir(modfile):
def flang_frontend_supports_f128():
- flang_exe = lit.util.which("flang", config.clang_tools_dir)
-
- if not flang_exe:
- return False
-
try:
testcode = b"real(16) :: x\nend"
flang_cmd = subprocess.run(
- [flang_exe, "--target=" + config.target_triple, "-fsyntax-only", "-"],
+ [config.flang_exe, "--target=" + config.target_triple, "-fsyntax-only", "-"],
input=testcode,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in
index 2a9c6735e9f196..ca94ef41533901 100644
--- a/flang/test/lit.site.cfg.py.in
+++ b/flang/test/lit.site.cfg.py.in
@@ -12,7 +12,6 @@ config.llvm_target_triple_env = "@LLVM_TARGET_TRIPLE_ENV@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"
config.flang_obj_root = path(r"@FLANG_BINARY_DIR@")
-config.clang_tools_dir = lit_config.substitute(path(r"@CURRENT_TOOLS_DIR@"))
config.flang_tools_dir = lit_config.substitute("@FLANG_TOOLS_DIR@")
config.flang_headers_dir = "@HEADER_BINARY_DIR@"
config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
>From 9100dac5bd368dacbb402c7191f7f584b95e8496 Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Wed, 9 Sep 2026 13:54:30 +0900
Subject: [PATCH 06/11] ensure that flang_frontend_supports_f128 always returns
a boolean
---
flang/test/lit.cfg.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index d7d6178f0e8855..5f583e1832e85a 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -278,8 +278,7 @@ def flang_frontend_supports_f128():
except OSError:
return False
- if flang_cmd.returncode == 0:
- return True
+ return flang_cmd.returncode == 0
# Add features and substitutions to test F128 math support.
>From 140b43e4e448f5b992d112f605fb27640febb53a Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Wed, 9 Sep 2026 17:07:46 +0900
Subject: [PATCH 07/11] python format
---
flang/test/lit.cfg.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index 5f583e1832e85a..efc91c2bb9a492 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -270,7 +270,12 @@ def flang_frontend_supports_f128():
try:
testcode = b"real(16) :: x\nend"
flang_cmd = subprocess.run(
- [config.flang_exe, "--target=" + config.target_triple, "-fsyntax-only", "-"],
+ [
+ config.flang_exe,
+ "--target=" + config.target_triple,
+ "-fsyntax-only",
+ "-",
+ ],
input=testcode,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
>From 5e95e7da1b60bd9cd33eec2952a63178b8219cd4 Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Mon, 16 Nov 2026 15:21:59 +0900
Subject: [PATCH 08/11] Determine REAL(16) support from the backend
Query TargetLowering for native f128 support or the complete set of basic arithmetic libcalls instead of using build-host runtime configuration.
Update Flang tests to detect frontend REAL(16) support for the configured target.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
---
flang/include/flang/Tools/TargetSetup.h | 43 ++++++++-----------
flang/test/CMakeLists.txt | 10 -----
flang/test/Evaluate/fold-out_of_range.f90 | 2 +-
flang/test/Evaluate/folding07.f90 | 2 +-
flang/test/Evaluate/rewrite-out_of_range.F90 | 2 +-
flang/test/Integration/abi-indirect-call.f90 | 2 +-
flang/test/Integration/common-block.f90 | 2 +-
.../complex-div-to-llvm-kind16.f90 | 2 +-
flang/test/Integration/debug-complex-1.f90 | 2 +-
flang/test/Integration/real-descriptors.f90 | 2 +-
.../HLFIR/complex-div-to-hlfir-kind16.f90 | 2 +-
.../test/Lower/Intrinsics/acos_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/acos_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/acosd.f90 | 2 +-
.../test/Lower/Intrinsics/acosh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/acosh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/acospi.f90 | 2 +-
flang/test/Lower/Intrinsics/aint_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/anint_real16.f90 | 2 +-
.../test/Lower/Intrinsics/asin_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/asin_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/asind.f90 | 2 +-
.../test/Lower/Intrinsics/asinh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/asinh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/asinpi.f90 | 2 +-
flang/test/Lower/Intrinsics/atan2_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atan2pi.f90 | 2 +-
.../test/Lower/Intrinsics/atan_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/atan_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atand.f90 | 2 +-
.../test/Lower/Intrinsics/atanh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/atanh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atanpi.f90 | 2 +-
.../Lower/Intrinsics/bessel_j0_real16.f90 | 2 +-
.../Lower/Intrinsics/bessel_j1_real16.f90 | 2 +-
.../Lower/Intrinsics/bessel_jn_real16.f90 | 2 +-
.../Lower/Intrinsics/bessel_y0_real16.f90 | 2 +-
.../Lower/Intrinsics/bessel_y1_real16.f90 | 2 +-
.../Lower/Intrinsics/bessel_yn_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cabs_real16.f90 | 2 +-
.../test/Lower/Intrinsics/ceiling_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cos_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/cos_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cosd.f90 | 2 +-
.../test/Lower/Intrinsics/cosh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/cosh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cospi.f90 | 2 +-
flang/test/Lower/Intrinsics/dot_product.f90 | 2 +-
flang/test/Lower/Intrinsics/erf_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/erfc_real16.f90 | 2 +-
.../Lower/Intrinsics/erfc_scaled_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/exp_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/exp_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/exponent.f90 | 2 +-
flang/test/Lower/Intrinsics/fast-real-mod.f90 | 10 ++---
flang/test/Lower/Intrinsics/floor_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/fma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/fraction.f90 | 2 +-
flang/test/Lower/Intrinsics/gamma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/hypot_real16.f90 | 2 +-
.../Lower/Intrinsics/ieee_class_queries.f90 | 2 +-
.../test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +-
flang/test/Lower/Intrinsics/ieee_next.f90 | 2 +-
.../test/Lower/Intrinsics/ieee_unordered.f90 | 2 +-
flang/test/Lower/Intrinsics/isnan.f90 | 2 +-
flang/test/Lower/Intrinsics/log10_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/log_complex16.f90 | 2 +-
.../Lower/Intrinsics/log_gamma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/log_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/mod.f90 | 2 +-
flang/test/Lower/Intrinsics/nearest.f90 | 2 +-
flang/test/Lower/Intrinsics/nint_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/norm2.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_complex16.f90 | 2 +-
.../test/Lower/Intrinsics/pow_complex16i.f90 | 2 +-
.../test/Lower/Intrinsics/pow_complex16k.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/powi_real16.f90 | 2 +-
.../Lower/Intrinsics/random_number_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/reduce.f90 | 2 +-
flang/test/Lower/Intrinsics/rrspacing.f90 | 2 +-
flang/test/Lower/Intrinsics/scale.f90 | 2 +-
flang/test/Lower/Intrinsics/set_exponent.f90 | 2 +-
flang/test/Lower/Intrinsics/sin_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sin_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/sind.f90 | 2 +-
.../test/Lower/Intrinsics/sinh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sinh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/sinpi.f90 | 2 +-
.../test/Lower/Intrinsics/sqrt_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sqrt_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tan_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/tan_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tand.f90 | 2 +-
.../test/Lower/Intrinsics/tanh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/tanh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tanpi.f90 | 2 +-
.../parallel-firstprivate-clause-scalar.f90 | 2 +-
flang/test/Lower/basic-function.f90 | 2 +-
flang/test/Lower/complex-operations.f90 | 2 +-
flang/test/Lower/math-lowering/sign.f90 | 6 +--
flang/test/Lower/real-operations-1.f90 | 2 +-
flang/test/Semantics/data05.f90 | 2 +-
flang/test/Semantics/intrinsics01.f90 | 2 +-
flang/test/Semantics/kinds03.f90 | 2 +-
flang/test/Semantics/modfile12.f90 | 2 +-
flang/test/Semantics/modfile26.f90 | 2 +-
flang/test/Semantics/realkinds-aarch64-01.f90 | 2 +-
flang/test/Semantics/realkinds-systemz-01.f90 | 2 +-
flang/test/lit.cfg.py | 15 +------
flang/test/lit.site.cfg.py.in | 3 --
111 files changed, 132 insertions(+), 165 deletions(-)
diff --git a/flang/include/flang/Tools/TargetSetup.h b/flang/include/flang/Tools/TargetSetup.h
index 03a0acda3fb518..d7b8a9ba9166d6 100644
--- a/flang/include/flang/Tools/TargetSetup.h
+++ b/flang/include/flang/Tools/TargetSetup.h
@@ -9,10 +9,10 @@
#ifndef FORTRAN_TOOLS_TARGET_SETUP_H
#define FORTRAN_TOOLS_TARGET_SETUP_H
-#include "flang/Common/float128.h"
#include "flang/Evaluate/target.h"
#include "flang/Frontend/TargetOptions.h"
#include "llvm/CodeGen/TargetLowering.h"
+#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
@@ -61,40 +61,33 @@ namespace Fortran::tools {
break;
}
- // Check for kind=16 support. See flang/runtime/Float128Math/math-entries.h.
- // TODO: Take this from TargetInfo::getLongDoubleFormat for cross compilation.
-#ifdef FLANG_RUNTIME_F128_MATH_LIB
- constexpr bool f128Support = true; // use libquadmath wrappers
-#elif HAS_LDBL128
- constexpr bool f128Support = true; // use libm wrappers
-#else
- constexpr bool f128Support = false;
-#endif
-
- bool f128BESupport = false;
+ bool supportsF128 = false;
llvm::LLVMContext ctx;
std::unique_ptr<llvm::Module> dummyModule =
- std::make_unique<llvm::Module>("quad-test", ctx);
+ std::make_unique<llvm::Module>("f128-support", ctx);
dummyModule->setTargetTriple(targetMachine.getTargetTriple());
dummyModule->setDataLayout(targetMachine.createDataLayout());
llvm::FunctionType *dummyFTy =
llvm::FunctionType::get(llvm::Type::getVoidTy(ctx), false);
llvm::Function *dummyF = llvm::Function::Create(dummyFTy,
- llvm::GlobalValue::ExternalLinkage, "quad-test", dummyModule.get());
-
- const llvm::TargetLowering *dummyTLI =
- targetMachine.getSubtargetImpl(*dummyF)->getTargetLowering();
-
- if (dummyTLI) {
- llvm::EVT fp128EVT = llvm::EVT::getEVT(llvm::Type::getFP128Ty(ctx));
-
- // Query for fp128 backend support. Based on this, determine whether
- // compilation is possible on the frontend.
- f128BESupport = dummyTLI->isTypeLegal(fp128EVT);
+ llvm::GlobalValue::ExternalLinkage, "f128-support", dummyModule.get());
+
+ // TargetLowering is a per-function interface, so a dummy function is needed
+ // to query whether the backend can lower f128 for this target.
+ if (const llvm::TargetSubtargetInfo *subtarget =
+ targetMachine.getSubtargetImpl(*dummyF)) {
+ if (const llvm::TargetLowering *targetLowering =
+ subtarget->getTargetLowering()) {
+ supportsF128 = targetLowering->isTypeLegal(llvm::MVT::f128) ||
+ (targetLowering->getLibcallName(llvm::RTLIB::ADD_F128) &&
+ targetLowering->getLibcallName(llvm::RTLIB::SUB_F128) &&
+ targetLowering->getLibcallName(llvm::RTLIB::MUL_F128) &&
+ targetLowering->getLibcallName(llvm::RTLIB::DIV_F128));
+ }
}
- if (!f128Support && !f128BESupport) {
+ if (!supportsF128) {
targetCharacteristics.DisableType(Fortran::common::TypeCategory::Real, 16);
targetCharacteristics.DisableType(
Fortran::common::TypeCategory::Complex, 16);
diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt
index 50980a521b2410..9f9bbc1861328e 100644
--- a/flang/test/CMakeLists.txt
+++ b/flang/test/CMakeLists.txt
@@ -51,16 +51,6 @@ llvm_canonicalize_cmake_booleans(
set(FLANG_TOOLS_DIR ${FLANG_BINARY_DIR}/bin)
-# 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)
-
# FIXME In out-of-tree builds, "SHLIBDIR" is undefined and passing it to
# `configure_lit_site_cfg` leads to a configuration error. This is currently
# only required by plugins/examples, which are not supported in out-of-tree
diff --git a/flang/test/Evaluate/fold-out_of_range.f90 b/flang/test/Evaluate/fold-out_of_range.f90
index a2f453acb4cb2c..d4c591999fdb61 100644
--- a/flang/test/Evaluate/fold-out_of_range.f90
+++ b/flang/test/Evaluate/fold-out_of_range.f90
@@ -1,7 +1,7 @@
! RUN: %python %S/test_folding.py %s %flang_fc1 -pedantic -triple x86_64-unknown-linux-gnu
! UNSUPPORTED: system-windows
! REQUIRES: target=x86_64{{.*}}
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! Tests folding of OUT_OF_RANGE().
module m
integer(1), parameter :: i1v(*) = [ -huge(1_1) - 1_1, huge(1_1) ]
diff --git a/flang/test/Evaluate/folding07.f90 b/flang/test/Evaluate/folding07.f90
index d51df7acf7b8a6..414b7437439307 100644
--- a/flang/test/Evaluate/folding07.f90
+++ b/flang/test/Evaluate/folding07.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_folding.py %s %flang_fc1
! Test numeric model inquiry intrinsics
diff --git a/flang/test/Evaluate/rewrite-out_of_range.F90 b/flang/test/Evaluate/rewrite-out_of_range.F90
index 4555889fcc5a42..21bc586c2bb0ec 100644
--- a/flang/test/Evaluate/rewrite-out_of_range.F90
+++ b/flang/test/Evaluate/rewrite-out_of_range.F90
@@ -1,7 +1,7 @@
! Tests rewriting of OUT_OF_RANGE()
! REQUIRES: target=x86_64{{.*}}
! REQUIRES: system-linux
-! RUN: %flang_fc1 -fdebug-unparse -cpp %s 2>&1 | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{%if system-linux %{,CHECK-X86-64%}%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: %flang_fc1 -fdebug-unparse -cpp %s 2>&1 | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{%if system-linux %{,CHECK-X86-64%}%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
logical round
diff --git a/flang/test/Integration/abi-indirect-call.f90 b/flang/test/Integration/abi-indirect-call.f90
index 54a6adfb2c14a8..b8a717b5173035 100644
--- a/flang/test/Integration/abi-indirect-call.f90
+++ b/flang/test/Integration/abi-indirect-call.f90
@@ -1,5 +1,5 @@
!REQUIRES: x86-registered-target
-!REQUIRES: flang-supports-f128-math
+!REQUIRES: flang-frontend-supports-f128
!RUN: %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
! Test ABI of indirect calls is properly implemented in the LLVM IR.
diff --git a/flang/test/Integration/common-block.f90 b/flang/test/Integration/common-block.f90
index 5ffdd7df886d28..6428b869c01ddb 100644
--- a/flang/test/Integration/common-block.f90
+++ b/flang/test/Integration/common-block.f90
@@ -6,7 +6,7 @@
! added to this directory and sub-directories.
!===----------------------------------------------------------------------===!
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc %s -o - | tco | FileCheck %s
! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
diff --git a/flang/test/Integration/complex-div-to-llvm-kind16.f90 b/flang/test/Integration/complex-div-to-llvm-kind16.f90
index f61fd2f0d9e3c9..9cccf8095498ef 100644
--- a/flang/test/Integration/complex-div-to-llvm-kind16.f90
+++ b/flang/test/Integration/complex-div-to-llvm-kind16.f90
@@ -1,6 +1,6 @@
! Test lowering complex division to llvm ir according to options
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang -fcomplex-arithmetic=improved -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,IMPRVD
! RUN: %flang -fcomplex-arithmetic=basic -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,BASIC
diff --git a/flang/test/Integration/debug-complex-1.f90 b/flang/test/Integration/debug-complex-1.f90
index 206efed2ba089e..f646358a166038 100644
--- a/flang/test/Integration/debug-complex-1.f90
+++ b/flang/test/Integration/debug-complex-1.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
program mn
diff --git a/flang/test/Integration/real-descriptors.f90 b/flang/test/Integration/real-descriptors.f90
index 39380595a3428b..20712f350e6fa5 100644
--- a/flang/test/Integration/real-descriptors.f90
+++ b/flang/test/Integration/real-descriptors.f90
@@ -6,7 +6,7 @@
! added to this directory and sub-directories.
!===----------------------------------------------------------------------===!
-! RUN: bbc %s -o - | tco | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc %s -o - | tco | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: define void {{.*}}test_reals
subroutine test_reals(x2, x3, x4, x8, c2, c3, c4, c8)
diff --git a/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90 b/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
index e732221fa6d502..0532808d2a3a38 100644
--- a/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
+++ b/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
@@ -1,6 +1,6 @@
! Test lowering of complex division according to options
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -complex-range=full -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,FULL
! RUN: bbc -complex-range=improved -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,IMPRVD
! RUN: bbc -complex-range=basic -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,BASIC
diff --git a/flang/test/Lower/Intrinsics/acos_complex16.f90 b/flang/test/Lower/Intrinsics/acos_complex16.f90
index 9e9d4f1487d56c..dd23dcca9b2521 100644
--- a/flang/test/Lower/Intrinsics/acos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acos_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acos_real16.f90 b/flang/test/Lower/Intrinsics/acos_real16.f90
index 2a09bfe94a8013..26045a092d717c 100644
--- a/flang/test/Lower/Intrinsics/acos_real16.f90
+++ b/flang/test/Lower/Intrinsics/acos_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acosd.f90 b/flang/test/Lower/Intrinsics/acosd.f90
index 175a4902620b83..0de92c2d705afd 100644
--- a/flang/test/Lower/Intrinsics/acosd.f90
+++ b/flang/test/Lower/Intrinsics/acosd.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/acosh_complex16.f90 b/flang/test/Lower/Intrinsics/acosh_complex16.f90
index 69a23fb0f8410e..2cab3aa45215b4 100644
--- a/flang/test/Lower/Intrinsics/acosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acosh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acosh_real16.f90 b/flang/test/Lower/Intrinsics/acosh_real16.f90
index de787e3d2b0fb7..9a1f6f3f3acb24 100644
--- a/flang/test/Lower/Intrinsics/acosh_real16.f90
+++ b/flang/test/Lower/Intrinsics/acosh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acospi.f90 b/flang/test/Lower/Intrinsics/acospi.f90
index 75f50d0140e32c..2cf7777096a655 100644
--- a/flang/test/Lower/Intrinsics/acospi.f90
+++ b/flang/test/Lower/Intrinsics/acospi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -emit-hlfir -mllvm --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/aint_real16.f90 b/flang/test/Lower/Intrinsics/aint_real16.f90
index b8b80ea3097cf2..dec105b3a565e5 100644
--- a/flang/test/Lower/Intrinsics/aint_real16.f90
+++ b/flang/test/Lower/Intrinsics/aint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/anint_real16.f90 b/flang/test/Lower/Intrinsics/anint_real16.f90
index 677240dc41df0d..1e4f32d8545929 100644
--- a/flang/test/Lower/Intrinsics/anint_real16.f90
+++ b/flang/test/Lower/Intrinsics/anint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asin_complex16.f90 b/flang/test/Lower/Intrinsics/asin_complex16.f90
index 43aea8bd3c4c0f..f3d58cb5ab9f5b 100644
--- a/flang/test/Lower/Intrinsics/asin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asin_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asin_real16.f90 b/flang/test/Lower/Intrinsics/asin_real16.f90
index cb32d0a6af70dd..06556530e28e71 100644
--- a/flang/test/Lower/Intrinsics/asin_real16.f90
+++ b/flang/test/Lower/Intrinsics/asin_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asind.f90 b/flang/test/Lower/Intrinsics/asind.f90
index 8d6198f53e4b48..27e0d2ada20ee0 100644
--- a/flang/test/Lower/Intrinsics/asind.f90
+++ b/flang/test/Lower/Intrinsics/asind.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/asinh_complex16.f90 b/flang/test/Lower/Intrinsics/asinh_complex16.f90
index 6826a27406f909..2c4bb5e0f31dca 100644
--- a/flang/test/Lower/Intrinsics/asinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asinh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asinh_real16.f90 b/flang/test/Lower/Intrinsics/asinh_real16.f90
index 9ab16f19d933e6..556a37db232817 100644
--- a/flang/test/Lower/Intrinsics/asinh_real16.f90
+++ b/flang/test/Lower/Intrinsics/asinh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asinpi.f90 b/flang/test/Lower/Intrinsics/asinpi.f90
index 5a3be166345973..58c89f5b8378b5 100644
--- a/flang/test/Lower/Intrinsics/asinpi.f90
+++ b/flang/test/Lower/Intrinsics/asinpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/atan2_real16.f90 b/flang/test/Lower/Intrinsics/atan2_real16.f90
index 5d0bf3069342cb..8ac81c4cf181a2 100644
--- a/flang/test/Lower/Intrinsics/atan2_real16.f90
+++ b/flang/test/Lower/Intrinsics/atan2_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atan2pi.f90 b/flang/test/Lower/Intrinsics/atan2pi.f90
index 30887c1d398be4..743910029eac94 100644
--- a/flang/test/Lower/Intrinsics/atan2pi.f90
+++ b/flang/test/Lower/Intrinsics/atan2pi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
function test_real4(y, x)
diff --git a/flang/test/Lower/Intrinsics/atan_complex16.f90 b/flang/test/Lower/Intrinsics/atan_complex16.f90
index 08cd16025e5e20..df4d5a401bef4d 100644
--- a/flang/test/Lower/Intrinsics/atan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atan_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atan_real16.f90 b/flang/test/Lower/Intrinsics/atan_real16.f90
index 2bad58cf35f77b..63e8a96c08954e 100644
--- a/flang/test/Lower/Intrinsics/atan_real16.f90
+++ b/flang/test/Lower/Intrinsics/atan_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atand.f90 b/flang/test/Lower/Intrinsics/atand.f90
index 480bf5956f0619..3969cfe3cd187e 100644
--- a/flang/test/Lower/Intrinsics/atand.f90
+++ b/flang/test/Lower/Intrinsics/atand.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/atanh_complex16.f90 b/flang/test/Lower/Intrinsics/atanh_complex16.f90
index bc57bdf58c2c89..9576c0b3bdd313 100644
--- a/flang/test/Lower/Intrinsics/atanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atanh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atanh_real16.f90 b/flang/test/Lower/Intrinsics/atanh_real16.f90
index 0d60aecd08e1bc..b003fd16ea6a00 100644
--- a/flang/test/Lower/Intrinsics/atanh_real16.f90
+++ b/flang/test/Lower/Intrinsics/atanh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atanpi.f90 b/flang/test/Lower/Intrinsics/atanpi.f90
index 3f7642d35ffc80..ecb90cfe9b642c 100644
--- a/flang/test/Lower/Intrinsics/atanpi.f90
+++ b/flang/test/Lower/Intrinsics/atanpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/bessel_j0_real16.f90 b/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
index f1c07f6137d815..58743474ec6c88 100644
--- a/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_j1_real16.f90 b/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
index c41e7b5246adea..581abd47bf97e6 100644
--- a/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_jn_real16.f90 b/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
index 1ec9cc719a4182..5035a2502d6b55 100644
--- a/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_y0_real16.f90 b/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
index 459d2f4e7315fa..f2c0dc297b22af 100644
--- a/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_y1_real16.f90 b/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
index 869b2dc2c961b8..c96674d6f3ebad 100644
--- a/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_yn_real16.f90 b/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
index 53be23ab82d1ae..1d3d6eb5a18eaa 100644
--- a/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cabs_real16.f90 b/flang/test/Lower/Intrinsics/cabs_real16.f90
index c1ec0267c0f988..c83834cd5d1f29 100644
--- a/flang/test/Lower/Intrinsics/cabs_real16.f90
+++ b/flang/test/Lower/Intrinsics/cabs_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ceiling_real16.f90 b/flang/test/Lower/Intrinsics/ceiling_real16.f90
index 21dc221d6b35c6..471202fba91a47 100644
--- a/flang/test/Lower/Intrinsics/ceiling_real16.f90
+++ b/flang/test/Lower/Intrinsics/ceiling_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cos_complex16.f90 b/flang/test/Lower/Intrinsics/cos_complex16.f90
index d5e1249745e00c..3664097c443ec7 100644
--- a/flang/test/Lower/Intrinsics/cos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cos_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cos_real16.f90 b/flang/test/Lower/Intrinsics/cos_real16.f90
index 859d4a5671e8cb..7d0c38c434fde3 100644
--- a/flang/test/Lower/Intrinsics/cos_real16.f90
+++ b/flang/test/Lower/Intrinsics/cos_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cosd.f90 b/flang/test/Lower/Intrinsics/cosd.f90
index 4dbd718a28d6c8..b39b18747ffc3e 100644
--- a/flang/test/Lower/Intrinsics/cosd.f90
+++ b/flang/test/Lower/Intrinsics/cosd.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/cosh_complex16.f90 b/flang/test/Lower/Intrinsics/cosh_complex16.f90
index f2f170d9ba277a..f9f6bb1f019e4e 100644
--- a/flang/test/Lower/Intrinsics/cosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cosh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cosh_real16.f90 b/flang/test/Lower/Intrinsics/cosh_real16.f90
index cab85365661efa..2ebad29d863b03 100644
--- a/flang/test/Lower/Intrinsics/cosh_real16.f90
+++ b/flang/test/Lower/Intrinsics/cosh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cospi.f90 b/flang/test/Lower/Intrinsics/cospi.f90
index 5c612901d83027..2f9ffedd0fb042 100644
--- a/flang/test/Lower/Intrinsics/cospi.f90
+++ b/flang/test/Lower/Intrinsics/cospi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/dot_product.f90 b/flang/test/Lower/Intrinsics/dot_product.f90
index 62694a70555df5..67fc1ab0550781 100644
--- a/flang/test/Lower/Intrinsics/dot_product.f90
+++ b/flang/test/Lower/Intrinsics/dot_product.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -emit-fir -O0 %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: %flang_fc1 -emit-fir -O0 %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! DOT_PROD
! CHECK-LABEL: dot_prod_int_default
diff --git a/flang/test/Lower/Intrinsics/erf_real16.f90 b/flang/test/Lower/Intrinsics/erf_real16.f90
index e9cc6175c1284c..08d22acfbaa1b4 100644
--- a/flang/test/Lower/Intrinsics/erf_real16.f90
+++ b/flang/test/Lower/Intrinsics/erf_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/erfc_real16.f90 b/flang/test/Lower/Intrinsics/erfc_real16.f90
index d63c4d80df043c..5fe3708da0146b 100644
--- a/flang/test/Lower/Intrinsics/erfc_real16.f90
+++ b/flang/test/Lower/Intrinsics/erfc_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90 b/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
index 15c22e6142611c..089af27aebfe3e 100644
--- a/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
+++ b/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exp_complex16.f90 b/flang/test/Lower/Intrinsics/exp_complex16.f90
index e40207815ab7c3..9c730cf04d6db9 100644
--- a/flang/test/Lower/Intrinsics/exp_complex16.f90
+++ b/flang/test/Lower/Intrinsics/exp_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exp_real16.f90 b/flang/test/Lower/Intrinsics/exp_real16.f90
index aed7319a9eb2db..2d56871f38f6f3 100644
--- a/flang/test/Lower/Intrinsics/exp_real16.f90
+++ b/flang/test/Lower/Intrinsics/exp_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exponent.f90 b/flang/test/Lower/Intrinsics/exponent.f90
index f5f0603ee13c83..43f64bdcc1d6ed 100644
--- a/flang/test/Lower/Intrinsics/exponent.f90
+++ b/flang/test/Lower/Intrinsics/exponent.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! EXPONENT
diff --git a/flang/test/Lower/Intrinsics/fast-real-mod.f90 b/flang/test/Lower/Intrinsics/fast-real-mod.f90
index 6ecbb9b03f7017..7ab2a9c14e3448 100644
--- a/flang/test/Lower/Intrinsics/fast-real-mod.f90
+++ b/flang/test/Lower/Intrinsics/fast-real-mod.f90
@@ -1,8 +1,8 @@
-! RUN: %flang_fc1 -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-supports-f128-math %{,CHECK-FRM-KIND16%}
-! RUN: %flang_fc1 -ffast-real-mod -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-supports-f128-math %{,CHECK-NFRM-KIND16%}
-! RUN: %flang_fc1 -fno-fast-real-mod -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-supports-f128-math %{,CHECK-FRM-KIND16%}
-! RUN: %flang_fc1 -ffast-math -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FM%if target=x86_64{{.*}} %{,CHECK-FM-KIND10%}%if flang-supports-f128-math %{,CHECK-FM-KIND16%}
-! RUN: %flang_fc1 -ffast-math -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-supports-f128-math %{,CHECK-NFRM-KIND16%}
+! RUN: %flang_fc1 -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FRM-KIND16%}
+! RUN: %flang_fc1 -ffast-real-mod -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-NFRM-KIND16%}
+! RUN: %flang_fc1 -fno-fast-real-mod -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FRM-KIND16%}
+! RUN: %flang_fc1 -ffast-math -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FM%if target=x86_64{{.*}} %{,CHECK-FM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FM-KIND16%}
+! RUN: %flang_fc1 -ffast-math -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-NFRM-KIND16%}
! CHECK-FM: module attributes {{{.*}}fir.fast_real_mod = true{{.*}}}
! CHECK-FRM: module attributes {{{.*}}fir.fast_real_mod = true{{.*}}}
diff --git a/flang/test/Lower/Intrinsics/floor_real16.f90 b/flang/test/Lower/Intrinsics/floor_real16.f90
index 536c14106dd6f5..22c866332a6733 100644
--- a/flang/test/Lower/Intrinsics/floor_real16.f90
+++ b/flang/test/Lower/Intrinsics/floor_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/fma_real16.f90 b/flang/test/Lower/Intrinsics/fma_real16.f90
index ecc32635be9dcb..911acdac9daa10 100644
--- a/flang/test/Lower/Intrinsics/fma_real16.f90
+++ b/flang/test/Lower/Intrinsics/fma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/fraction.f90 b/flang/test/Lower/Intrinsics/fraction.f90
index 594beb97cc5a3d..02fdbb2c427875 100644
--- a/flang/test/Lower/Intrinsics/fraction.f90
+++ b/flang/test/Lower/Intrinsics/fraction.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! FRACTION
diff --git a/flang/test/Lower/Intrinsics/gamma_real16.f90 b/flang/test/Lower/Intrinsics/gamma_real16.f90
index aabf7fb73f0b2a..fa1ce52b4016ca 100644
--- a/flang/test/Lower/Intrinsics/gamma_real16.f90
+++ b/flang/test/Lower/Intrinsics/gamma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/hypot_real16.f90 b/flang/test/Lower/Intrinsics/hypot_real16.f90
index 753148ede29cd6..57311a67b696a5 100644
--- a/flang/test/Lower/Intrinsics/hypot_real16.f90
+++ b/flang/test/Lower/Intrinsics/hypot_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ieee_class_queries.f90 b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
index 8d20ff8f3178fe..a2b35379d8554d 100644
--- a/flang/test/Lower/Intrinsics/ieee_class_queries.f90
+++ b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! REQUIRES: x86-registered-target
! RUN: bbc -target x86_64-unknown-linux-gnu -emit-fir -o - %s | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90
index d55b2e3c08561b..0395e007ef5691 100644
--- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90
+++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: ieee_is_normal_f16
subroutine ieee_is_normal_f16(r)
diff --git a/flang/test/Lower/Intrinsics/ieee_next.f90 b/flang/test/Lower/Intrinsics/ieee_next.f90
index 585becda908821..8e77bfee5f34b4 100644
--- a/flang/test/Lower/Intrinsics/ieee_next.f90
+++ b/flang/test/Lower/Intrinsics/ieee_next.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
module ieee_next_tests
use ieee_arithmetic, only: ieee_value, ieee_negative_inf, ieee_positive_inf
diff --git a/flang/test/Lower/Intrinsics/ieee_unordered.f90 b/flang/test/Lower/Intrinsics/ieee_unordered.f90
index 6e2d40b3f4c32e..4f73d03d29336f 100644
--- a/flang/test/Lower/Intrinsics/ieee_unordered.f90
+++ b/flang/test/Lower/Intrinsics/ieee_unordered.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
! CHECK-LABEL: func @_QQmain
diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90
index 6535724b2ce3b6..17c1a7089952ab 100644
--- a/flang/test/Lower/Intrinsics/isnan.f90
+++ b/flang/test/Lower/Intrinsics/isnan.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: isnan_f32
subroutine isnan_f32(r)
diff --git a/flang/test/Lower/Intrinsics/log10_real16.f90 b/flang/test/Lower/Intrinsics/log10_real16.f90
index 3a6e1d1af91122..d13a1cf7c3ea06 100644
--- a/flang/test/Lower/Intrinsics/log10_real16.f90
+++ b/flang/test/Lower/Intrinsics/log10_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_complex16.f90 b/flang/test/Lower/Intrinsics/log_complex16.f90
index 600d7f9b7dc479..ded9b4e0717246 100644
--- a/flang/test/Lower/Intrinsics/log_complex16.f90
+++ b/flang/test/Lower/Intrinsics/log_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_gamma_real16.f90 b/flang/test/Lower/Intrinsics/log_gamma_real16.f90
index 771ec4e5d931dc..35500c539f1569 100644
--- a/flang/test/Lower/Intrinsics/log_gamma_real16.f90
+++ b/flang/test/Lower/Intrinsics/log_gamma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_real16.f90 b/flang/test/Lower/Intrinsics/log_real16.f90
index a57b8cc8e96980..3038a6452a5230 100644
--- a/flang/test/Lower/Intrinsics/log_real16.f90
+++ b/flang/test/Lower/Intrinsics/log_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/mod.f90 b/flang/test/Lower/Intrinsics/mod.f90
index 5bc81d923b800d..087fd1a9cbe74a 100644
--- a/flang/test/Lower/Intrinsics/mod.f90
+++ b/flang/test/Lower/Intrinsics/mod.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: func @_QPmod_testr4(
subroutine mod_testr4(r, a, p)
diff --git a/flang/test/Lower/Intrinsics/nearest.f90 b/flang/test/Lower/Intrinsics/nearest.f90
index 95e3ea52f69c8c..409d984c0dd71c 100644
--- a/flang/test/Lower/Intrinsics/nearest.f90
+++ b/flang/test/Lower/Intrinsics/nearest.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: c.func @_QPnearest_test1
! CHECK: %[[V_0:[0-9]+]] = fir.dummy_scope : !fir.dscope
diff --git a/flang/test/Lower/Intrinsics/nint_real16.f90 b/flang/test/Lower/Intrinsics/nint_real16.f90
index c4bbacd0347c04..90c934899567a8 100644
--- a/flang/test/Lower/Intrinsics/nint_real16.f90
+++ b/flang/test/Lower/Intrinsics/nint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/norm2.f90 b/flang/test/Lower/Intrinsics/norm2.f90
index ec89caa51d1a5e..569bcca978f7f4 100644
--- a/flang/test/Lower/Intrinsics/norm2.f90
+++ b/flang/test/Lower/Intrinsics/norm2.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: func @_QPnorm2_test_4(
real(4) function norm2_test_4(a)
diff --git a/flang/test/Lower/Intrinsics/pow_complex16.f90 b/flang/test/Lower/Intrinsics/pow_complex16.f90
index c026dd242e964d..b0bef4d6a6225c 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16i.f90 b/flang/test/Lower/Intrinsics/pow_complex16i.f90
index ea18d67b754600..f92218b7cae4d1 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16i.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16i.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16k.f90 b/flang/test/Lower/Intrinsics/pow_complex16k.f90
index d2b70185bda9f3..71f117faef275c 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16k.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16k.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_real16.f90 b/flang/test/Lower/Intrinsics/pow_real16.f90
index 869422381401dc..56682f81a65bf9 100644
--- a/flang/test/Lower/Intrinsics/pow_real16.f90
+++ b/flang/test/Lower/Intrinsics/pow_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/powi_real16.f90 b/flang/test/Lower/Intrinsics/powi_real16.f90
index dc19b32742c0b9..f6476c1a5db36a 100644
--- a/flang/test/Lower/Intrinsics/powi_real16.f90
+++ b/flang/test/Lower/Intrinsics/powi_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-FAST
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-PRECISE
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-FAST
diff --git a/flang/test/Lower/Intrinsics/random_number_real16.f90 b/flang/test/Lower/Intrinsics/random_number_real16.f90
index 1597d9bd5397fc..6347830a548199 100644
--- a/flang/test/Lower/Intrinsics/random_number_real16.f90
+++ b/flang/test/Lower/Intrinsics/random_number_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/reduce.f90 b/flang/test/Lower/Intrinsics/reduce.f90
index 27c4277ffebebd..70dd4d6f54f11f 100644
--- a/flang/test/Lower/Intrinsics/reduce.f90
+++ b/flang/test/Lower/Intrinsics/reduce.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
module reduce_mod
diff --git a/flang/test/Lower/Intrinsics/rrspacing.f90 b/flang/test/Lower/Intrinsics/rrspacing.f90
index 8646068a421e55..a33f86fcea2d60 100644
--- a/flang/test/Lower/Intrinsics/rrspacing.f90
+++ b/flang/test/Lower/Intrinsics/rrspacing.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
! CHECK-LABEL: func @_QPrrspacing_test2(
diff --git a/flang/test/Lower/Intrinsics/scale.f90 b/flang/test/Lower/Intrinsics/scale.f90
index 9034c48e639b59..7f212ac850b264 100644
--- a/flang/test/Lower/Intrinsics/scale.f90
+++ b/flang/test/Lower/Intrinsics/scale.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! CHECK-LABEL: scale_test1
subroutine scale_test1(x, i)
diff --git a/flang/test/Lower/Intrinsics/set_exponent.f90 b/flang/test/Lower/Intrinsics/set_exponent.f90
index a06be6aac44199..0012b262836f86 100644
--- a/flang/test/Lower/Intrinsics/set_exponent.f90
+++ b/flang/test/Lower/Intrinsics/set_exponent.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! SET_EXPONENT
! CHECK-LABEL: set_exponent_test_4
diff --git a/flang/test/Lower/Intrinsics/sin_complex16.f90 b/flang/test/Lower/Intrinsics/sin_complex16.f90
index d170e6303192f4..66b57c3ec3309f 100644
--- a/flang/test/Lower/Intrinsics/sin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sin_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sin_real16.f90 b/flang/test/Lower/Intrinsics/sin_real16.f90
index d09c71fb03e26c..9c1593580099aa 100644
--- a/flang/test/Lower/Intrinsics/sin_real16.f90
+++ b/flang/test/Lower/Intrinsics/sin_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sind.f90 b/flang/test/Lower/Intrinsics/sind.f90
index 1fb063117eb8d9..2f190597164fd3 100644
--- a/flang/test/Lower/Intrinsics/sind.f90
+++ b/flang/test/Lower/Intrinsics/sind.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/sinh_complex16.f90 b/flang/test/Lower/Intrinsics/sinh_complex16.f90
index ff2bd3420ea149..7e6f1c60830512 100644
--- a/flang/test/Lower/Intrinsics/sinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sinh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sinh_real16.f90 b/flang/test/Lower/Intrinsics/sinh_real16.f90
index 79aa71940aff8a..737382fe6d3206 100644
--- a/flang/test/Lower/Intrinsics/sinh_real16.f90
+++ b/flang/test/Lower/Intrinsics/sinh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sinpi.f90 b/flang/test/Lower/Intrinsics/sinpi.f90
index 06699b7f8ea718..58b497f161bcce 100644
--- a/flang/test/Lower/Intrinsics/sinpi.f90
+++ b/flang/test/Lower/Intrinsics/sinpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/sqrt_complex16.f90 b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
index 7f30befe9cb871..e10749cc02f8d2 100644
--- a/flang/test/Lower/Intrinsics/sqrt_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sqrt_real16.f90 b/flang/test/Lower/Intrinsics/sqrt_real16.f90
index ac08c8c79e9a84..debd67f9a3970e 100644
--- a/flang/test/Lower/Intrinsics/sqrt_real16.f90
+++ b/flang/test/Lower/Intrinsics/sqrt_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tan_complex16.f90 b/flang/test/Lower/Intrinsics/tan_complex16.f90
index b6ed0bb4515b59..a3572cc6c7d408 100644
--- a/flang/test/Lower/Intrinsics/tan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tan_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tan_real16.f90 b/flang/test/Lower/Intrinsics/tan_real16.f90
index 62aa403fe58ce3..14e57291abc77e 100644
--- a/flang/test/Lower/Intrinsics/tan_real16.f90
+++ b/flang/test/Lower/Intrinsics/tan_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tand.f90 b/flang/test/Lower/Intrinsics/tand.f90
index 8c8927e6f5a991..61b8818d90c63e 100644
--- a/flang/test/Lower/Intrinsics/tand.f90
+++ b/flang/test/Lower/Intrinsics/tand.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/tanh_complex16.f90 b/flang/test/Lower/Intrinsics/tanh_complex16.f90
index 22e5b85bb3c098..fe1c1798f5ebfb 100644
--- a/flang/test/Lower/Intrinsics/tanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tanh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tanh_real16.f90 b/flang/test/Lower/Intrinsics/tanh_real16.f90
index aff7e7b31d7543..13e19578248f3c 100644
--- a/flang/test/Lower/Intrinsics/tanh_real16.f90
+++ b/flang/test/Lower/Intrinsics/tanh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tanpi.f90 b/flang/test/Lower/Intrinsics/tanpi.f90
index 0a011047ce93e9..be08d176a3daa4 100644
--- a/flang/test/Lower/Intrinsics/tanpi.f90
+++ b/flang/test/Lower/Intrinsics/tanpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
index a049b43e85ed94..78d131e7edd443 100644
--- a/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
+++ b/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
@@ -2,7 +2,7 @@
! REQUIRES: x86-registered-target
! RUN: bbc -target x86_64-unknown-linux-gnu -fopenmp -emit-hlfir %s -o - \
-! RUN: | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
!CHECK: omp.private {type = firstprivate} @[[ARG2_LOGICAL_PRIVATIZER:_QFfirstprivate_logicalEarg2_firstprivate_l8]] : !fir.logical<1>
diff --git a/flang/test/Lower/basic-function.f90 b/flang/test/Lower/basic-function.f90
index c250a988bf7b3c..55a5de0c438155 100644
--- a/flang/test/Lower/basic-function.f90
+++ b/flang/test/Lower/basic-function.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
integer(1) function fct1()
end
diff --git a/flang/test/Lower/complex-operations.f90 b/flang/test/Lower/complex-operations.f90
index fbc905d6975473..b23c6681201ab2 100644
--- a/flang/test/Lower/complex-operations.f90
+++ b/flang/test/Lower/complex-operations.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! REQUIRES: x86-registered-target
! RUN: %flang_fc1 -emit-hlfir -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
diff --git a/flang/test/Lower/math-lowering/sign.f90 b/flang/test/Lower/math-lowering/sign.f90
index 534a6679fbeff0..fd15eca6b6b642 100644
--- a/flang/test/Lower/math-lowering/sign.f90
+++ b/flang/test/Lower/math-lowering/sign.f90
@@ -1,11 +1,11 @@
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=fast %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,FAST%if target=x86_64{{.*}} %{,ALL-KIND10,FAST-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,FAST-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,FAST%if target=x86_64{{.*}} %{,ALL-KIND10,FAST-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,FAST-KIND16%}
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=relaxed %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,RELAXED%if target=x86_64{{.*}} %{,ALL-KIND10,RELAXED-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,RELAXED-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,RELAXED%if target=x86_64{{.*}} %{,ALL-KIND10,RELAXED-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,RELAXED-KIND16%}
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=precise %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,PRECISE%if target=x86_64{{.*}} %{,ALL-KIND10,PRECISE-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,PRECISE-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,PRECISE%if target=x86_64{{.*}} %{,ALL-KIND10,PRECISE-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,PRECISE-KIND16%}
function test_real4(x, y)
real :: x, y, test_real4
diff --git a/flang/test/Lower/real-operations-1.f90 b/flang/test/Lower/real-operations-1.f90
index d155b7dc9570f5..0cb2d53eef7c1b 100644
--- a/flang/test/Lower/real-operations-1.f90
+++ b/flang/test/Lower/real-operations-1.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
! Test real add on real kinds.
! CHECK-LABEL: real2
diff --git a/flang/test/Semantics/data05.f90 b/flang/test/Semantics/data05.f90
index c3591c1c5da8a2..2cfe15f572d1ce 100644
--- a/flang/test/Semantics/data05.f90
+++ b/flang/test/Semantics/data05.f90
@@ -1,4 +1,4 @@
-!REQUIRES: flang-supports-f128-math
+!REQUIRES: flang-frontend-supports-f128
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
module m
interface
diff --git a/flang/test/Semantics/intrinsics01.f90 b/flang/test/Semantics/intrinsics01.f90
index 74778914fc7e5d..eb24ea1a09929e 100644
--- a/flang/test/Semantics/intrinsics01.f90
+++ b/flang/test/Semantics/intrinsics01.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for semantic errors for DREAL, DIMAG, DCONJG intrinsics
diff --git a/flang/test/Semantics/kinds03.f90 b/flang/test/Semantics/kinds03.f90
index 12c7aaf88e2df1..ca1e31272f41b9 100644
--- a/flang/test/Semantics/kinds03.f90
+++ b/flang/test/Semantics/kinds03.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_symbols.py %s %flang_fc1
!DEF: /MainProgram1/ipdt DerivedType
!DEF: /MainProgram1/ipdt/k TypeParam INTEGER(4)
diff --git a/flang/test/Semantics/modfile12.f90 b/flang/test/Semantics/modfile12.f90
index 8bb6a2c413d8e6..aab2e0f4b162c5 100644
--- a/flang/test/Semantics/modfile12.f90
+++ b/flang/test/Semantics/modfile12.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_modfile.py %s %flang_fc1
module m
integer(8), parameter :: a = 1, b = 2_8
diff --git a/flang/test/Semantics/modfile26.f90 b/flang/test/Semantics/modfile26.f90
index 9c5d0015d91631..33b29f54f2e122 100644
--- a/flang/test/Semantics/modfile26.f90
+++ b/flang/test/Semantics/modfile26.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_modfile.py %s %flang_fc1
! Intrinsics SELECTED_INT_KIND, SELECTED_REAL_KIND, PRECISION, RANGE,
! RADIX, DIGITS
diff --git a/flang/test/Semantics/realkinds-aarch64-01.f90 b/flang/test/Semantics/realkinds-aarch64-01.f90
index 2520c0b84c0e67..327911c489a91d 100644
--- a/flang/test/Semantics/realkinds-aarch64-01.f90
+++ b/flang/test/Semantics/realkinds-aarch64-01.f90
@@ -1,5 +1,5 @@
! REQUIRES: aarch64-registered-target
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_modfile.py %s %flang_fc1 -triple aarch64-unknown-linux-gnu
module m1
diff --git a/flang/test/Semantics/realkinds-systemz-01.f90 b/flang/test/Semantics/realkinds-systemz-01.f90
index 20d7ee707349ca..4026cbd3990bc8 100644
--- a/flang/test/Semantics/realkinds-systemz-01.f90
+++ b/flang/test/Semantics/realkinds-systemz-01.f90
@@ -1,5 +1,5 @@
! REQUIRES: systemz-registered-target
-! REQUIRES: flang-supports-f128-math
+! REQUIRES: flang-frontend-supports-f128
! RUN: %python %S/test_modfile.py %s %flang_fc1 -triple s390x-unknown-linux-gnu
module m1
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index efc91c2bb9a492..4184669f7fef7f 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -286,22 +286,9 @@ def flang_frontend_supports_f128():
return flang_cmd.returncode == 0
-# Add features and substitutions to test F128 math support.
-# %f128-lib substitution may be used to generate check prefixes
-# for LIT tests checking for F128 library support.
-if config.flang_runtime_f128_math_lib or config.have_ldbl_mant_dig_113:
- config.available_features.add("flang-supports-f128-math")
+# Add a feature for tests that require frontend F128 support.
if flang_frontend_supports_f128():
config.available_features.add("flang-frontend-supports-f128")
-if config.flang_runtime_f128_math_lib:
- config.available_features.add(
- "flang-f128-math-lib-" + config.flang_runtime_f128_math_lib
- )
- config.substitutions.append(
- ("%f128-lib", config.flang_runtime_f128_math_lib.upper())
- )
-else:
- config.substitutions.append(("%f128-lib", "NONE"))
# Set OBJECT_MODE=64 as tools on AIX default to 32-bit.
if "system-aix" in config.available_features:
diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in
index ca94ef41533901..fdeb224b228ff3 100644
--- a/flang/test/lit.site.cfg.py.in
+++ b/flang/test/lit.site.cfg.py.in
@@ -30,9 +30,6 @@ config.osx_sysroot = path(r"@CMAKE_OSX_SYSROOT@")
config.targets_to_build = "@TARGETS_TO_BUILD@"
config.default_sysroot = "@DEFAULT_SYSROOT@"
config.clang_default_unwindlib = "@CLANG_DEFAULT_UNWINDLIB@"
-config.flang_runtime_f128_math_lib = "@FLANG_RUNTIME_F128_MATH_LIB@"
-config.have_ldbl_mant_dig_113 = "@HAVE_LDBL_MANT_DIG_113@"
-
config.perf_helper_dir = "@LLVM_MAIN_SRC_DIR@/../clang/utils/perf-training"
config.flang_bolt_mode = "@FLANG_BOLT@"
config.flang_bolt_name = "@FLANG_BOLT_INSTRUMENTED@"
>From 76e64ca6c0e319dee6b56ec265c5927c990c02ae Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Mon, 16 Nov 2026 15:22:37 +0900
Subject: [PATCH 09/11] Separate REAL(16) runtime configuration
Move target F128 math provider configuration into flang-rt while retaining host quadmath detection for Flang constant folding.
Provide a quadmath archive independently of frontend support. Leave it empty when no math provider is configured, so missing math entry points fail at link time.
During LLVM bootstrap, enable REAL(16) when a math provider is selected, for AArch64 and x86-64 targets, or for native targets with 113-bit long double. Honor explicit FORTRAN_SUPPORTS_REAL16 settings because fakeflang cannot probe REAL(16). Keep compiler probing for standalone flang-rt builds, including per-target and multilib configurations.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
---
clang/include/clang/Driver/Driver.h | 10 --
clang/lib/Driver/ToolChain.cpp | 12 +--
flang-rt/CMakeLists.txt | 2 +-
flang-rt/README.md | 11 ++-
.../cmake/modules/FlangRTFloat128.cmake | 10 +-
flang-rt/lib/quadmath/CMakeLists.txt | 51 ++++------
flang-rt/lib/quadmath/unsupported.cpp | 7 ++
flang/CMakeLists.txt | 3 +-
flang/cmake/modules/FindFlangQuadmath.cmake | 62 ++++++++++++
flang/cmake/quadmath_wrapper.h.in | 2 +-
flang/docs/GettingStarted.md | 12 +--
flang/docs/Real16MathSupport.md | 42 +++++---
flang/lib/Evaluate/CMakeLists.txt | 2 +-
flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 11 +--
flang/test/Driver/linker-flags.f90 | 40 ++++----
flang/tools/flang-driver/driver.cpp | 3 -
llvm/runtimes/CMakeLists.txt | 96 +++++++++++++------
17 files changed, 223 insertions(+), 153 deletions(-)
rename flang/cmake/modules/FlangCommon.cmake => flang-rt/cmake/modules/FlangRTFloat128.cmake (87%)
create mode 100644 flang-rt/lib/quadmath/unsupported.cpp
create mode 100644 flang/cmake/modules/FindFlangQuadmath.cmake
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h
index f4f0e20e78f5a2..bfd25c344a7e69 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -258,11 +258,6 @@ class Driver {
/// from non-system headers are emitted.
HeaderIncludeFilteringKind CCPrintHeadersFiltering = HIFIL_None;
- /// Name of the library that provides implementations of
- /// IEEE-754 128-bit float math functions used by Fortran F128
- /// runtime library. It should be linked as needed by the linker job.
- std::string FlangF128MathLibrary;
-
/// Set CC_LOG_DIAGNOSTICS mode, which causes the frontend to log diagnostics
/// to CCLogDiagnosticsFilename or to stderr, in a stable machine readable
/// format.
@@ -447,11 +442,6 @@ class Driver {
bool offloadHostOnly() const { return Offload == OffloadHost; }
bool offloadDeviceOnly() const { return Offload == OffloadDevice; }
- void setFlangF128MathLibrary(std::string name) {
- FlangF128MathLibrary = std::move(name);
- }
- StringRef getFlangF128MathLibrary() const { return FlangF128MathLibrary; }
-
/// Compute the desired OpenMP runtime from the flags provided.
OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const;
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 2a17df5ff9132e..b024bc6cba85a6 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -978,17 +978,7 @@ void ToolChain::addFortranRuntimeLibs(const ArgList &Args,
// add the correct libraries to link against as dependents in the object
// file.
if (!getTriple().isKnownWindowsMSVCEnvironment()) {
- StringRef F128LibName = getDriver().getFlangF128MathLibrary();
- F128LibName.consume_front_insensitive("lib");
- if (!F128LibName.empty()) {
- bool AsNeeded = !getTriple().isOSAIX();
- CmdArgs.push_back("-lflang_rt.quadmath");
- if (AsNeeded)
- addAsNeededOption(*this, Args, CmdArgs, /*as_needed=*/true);
- CmdArgs.push_back(Args.MakeArgString("-l" + F128LibName));
- if (AsNeeded)
- addAsNeededOption(*this, Args, CmdArgs, /*as_needed=*/false);
- }
+ CmdArgs.push_back("-lflang_rt.quadmath");
addFlangRTLibPath(Args, CmdArgs);
// needs libexecinfo for backtrace functions
diff --git a/flang-rt/CMakeLists.txt b/flang-rt/CMakeLists.txt
index 4f480151eb56bb..72ecdff32a2cfa 100644
--- a/flang-rt/CMakeLists.txt
+++ b/flang-rt/CMakeLists.txt
@@ -68,7 +68,7 @@ list(APPEND CMAKE_MODULE_PATH
)
include(AddFlangRT)
include(GetToolchainDirs)
-include(FlangCommon)
+include(FlangRTFloat128)
include(HandleCompilerRT)
include(ExtendPath)
include(FlangRTIntrospection)
diff --git a/flang-rt/README.md b/flang-rt/README.md
index 7d8e8da7106241..029ec0c6696fca 100644
--- a/flang-rt/README.md
+++ b/flang-rt/README.md
@@ -141,9 +141,14 @@ CMake itself provide.
Determines the implementation of `REAL(16)` math functions. If set to
`libquadmath`, uses `quadmath.h` and `-lquadmath` typically distributed with
- gcc. If empty, disables `REAL(16)` support. For any other value, introspects
- the compiler for `__float128` or 128-bit `long double` support.
- [More details](docs/Real16MathSupport.md).
+ gcc. If empty, automatically uses `libm` when `long double` has 113
+ significand bits; otherwise, no `REAL(16)` math entry points are provided
+ by `libflang_rt.quadmath`. Any other nonempty value is unsupported.
+
+ When `libm` is selected automatically, configuration fails if its `sinl`
+ function cannot be found. The Flang driver does not add `-lquadmath`
+ automatically.
+ [More details](../flang/docs/Real16MathSupport.md).
* `FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT` (values: `"CUDA"`, `""` default: `""`)
diff --git a/flang/cmake/modules/FlangCommon.cmake b/flang-rt/cmake/modules/FlangRTFloat128.cmake
similarity index 87%
rename from flang/cmake/modules/FlangCommon.cmake
rename to flang-rt/cmake/modules/FlangRTFloat128.cmake
index a1e80f737e5437..05b67a71282e02 100644
--- a/flang/cmake/modules/FlangCommon.cmake
+++ b/flang-rt/cmake/modules/FlangRTFloat128.cmake
@@ -1,23 +1,15 @@
-#===-- cmake/modules/FlangCommon.txt ----------------------------===#
+#===-- cmake/modules/FlangRTFloat128.cmake ----------------------===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
-#
-# CMake definitions shared between Flang and Flang-RT
-#
-#===------------------------------------------------------------------------===#
include(CheckCSourceCompiles)
include(CheckIncludeFile)
include(CMakePushCheckState)
-# The out of tree builds of the compiler and the Fortran runtime
-# must use the same setting of FLANG_RUNTIME_F128_MATH_LIB
-# to be composable. Failure to synchronize this setting may result
-# in linking errors or fatal failures in F128 runtime functions.
set(FLANG_RUNTIME_F128_MATH_LIB "" CACHE STRING
"Specifies the target library used for implementing IEEE-754 128-bit float \
math in F18 runtime, e.g. it might be libquadmath for targets where \
diff --git a/flang-rt/lib/quadmath/CMakeLists.txt b/flang-rt/lib/quadmath/CMakeLists.txt
index 353c72def24de8..f8fa026ec3e45c 100644
--- a/flang-rt/lib/quadmath/CMakeLists.txt
+++ b/flang-rt/lib/quadmath/CMakeLists.txt
@@ -7,8 +7,8 @@
#===------------------------------------------------------------------------===#
# FortranFloat128 implements IEEE-754 128-bit float math functions.
-# It is a thin wapper and it currently relies on third-party
-# libraries available for the target.
+# It uses a third-party library when one is configured for the target and
+# otherwise provides an empty archive.
# It is distributed as a static library only.
# Fortran programs/libraries that end up linking any of the provided
# will have a dependency on the third-party library that is being
@@ -17,7 +17,7 @@
include(CheckLibraryExists)
include(CheckIncludeFile)
-set(sources
+set(math_sources
acos.cpp
acosh.cpp
asin.cpp
@@ -69,6 +69,7 @@ set(sources
y1.cpp
yn.cpp
)
+set(sources unsupported.cpp)
include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}/..")
add_library(FortranFloat128MathILib INTERFACE)
@@ -79,7 +80,9 @@ target_include_directories(FortranFloat128MathILib INTERFACE
if (FLANG_RUNTIME_F128_MATH_LIB)
if (${FLANG_RUNTIME_F128_MATH_LIB} STREQUAL "libquadmath")
if(FLANG_INCLUDE_QUADMATH_H)
- add_compile_definitions(HAS_QUADMATHLIB)
+ target_compile_definitions(FortranFloat128MathILib INTERFACE
+ HAS_QUADMATHLIB
+ )
else()
message(FATAL_ERROR
"FLANG_RUNTIME_F128_MATH_LIB setting requires quadmath.h "
@@ -92,19 +95,7 @@ if (FLANG_RUNTIME_F128_MATH_LIB)
"${FLANG_RUNTIME_F128_MATH_LIB}"
)
endif()
-
- if (WIN32)
- # Do not create a flang_rt.quadmath library under Windows, the Flang
- # driver never links it. Instead, add the sources to flang_rt.runtime.
- target_sources(FortranFloat128MathILib INTERFACE ${sources})
- target_compile_definitions(FortranFloat128MathILib INTERFACE HAS_QUADMATHLIB)
- else ()
- add_flangrt_library(flang_rt.quadmath STATIC INSTALL_WITH_TOOLCHAIN
- ${sources})
- target_include_directories(flang_rt.quadmath PRIVATE
- "${FLANG_RT_SOURCE_DIR}/lib/flang_rt"
- )
- endif ()
+ list(APPEND sources ${math_sources})
elseif (HAVE_LDBL_MANT_DIG_113)
# We can use 'long double' versions from libc.
check_library_exists(m sinl "" FOUND_LIBM)
@@ -115,21 +106,21 @@ elseif (HAVE_LDBL_MANT_DIG_113)
target_include_directories(FortranFloat128MathILib INTERFACE
"${FLANG_RT_SOURCE_DIR}/lib/flang_rt"
)
- target_sources(FortranFloat128MathILib INTERFACE ${sources})
+ list(APPEND sources ${math_sources})
else()
message(FATAL_ERROR "Flang-RT cannot build without libm")
endif()
+endif()
+
+if (MSVC)
+ # The Flang driver does not link flang_rt.quadmath for MSVC targets.
+ # Instead, add the sources to flang_rt.runtime.
+ target_sources(FortranFloat128MathILib INTERFACE ${sources})
else()
- # We can use '__float128' version from libc, if it has them.
- check_library_exists(m sinf128 "" FOUND_LIBMF128)
- if (FOUND_LIBMF128)
- target_compile_definitions(FortranFloat128MathILib INTERFACE
- HAS_LIBMF128
- )
- target_include_directories(FortranFloat128MathILib INTERFACE
- "${FLANG_RT_SOURCE_DIR}/lib/flang_rt"
- )
- # Enable this, when math-entries.h and complex-math.h is ready.
- # target_sources(FortranFloat128MathILib INTERFACE ${sources})
- endif()
+ add_flangrt_library(flang_rt.quadmath STATIC INSTALL_WITH_TOOLCHAIN
+ ${sources})
+ target_include_directories(flang_rt.quadmath PRIVATE
+ "${FLANG_RT_SOURCE_DIR}/lib/flang_rt"
+ )
+ target_link_libraries(flang_rt.quadmath PRIVATE FortranFloat128MathILib)
endif()
diff --git a/flang-rt/lib/quadmath/unsupported.cpp b/flang-rt/lib/quadmath/unsupported.cpp
new file mode 100644
index 00000000000000..b12daf2924de68
--- /dev/null
+++ b/flang-rt/lib/quadmath/unsupported.cpp
@@ -0,0 +1,7 @@
+//===-- lib/quadmath/unsupported.cpp --------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index 0c5a690f8712fd..ddb20a944b886a 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -488,7 +488,7 @@ if (FLANG_PARALLEL_COMPILE_JOBS)
endif()
include(AddFlang)
-include(FlangCommon)
+include(FindFlangQuadmath)
include(GetClangResourceDir)
get_clang_resource_dir(HEADER_BINARY_DIR PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. SUBDIR include)
@@ -597,4 +597,3 @@ install(
COMPONENT flang-fortran-binding)
add_llvm_install_targets(install-flang-fortran-binding
COMPONENT flang-fortran-binding)
-
diff --git a/flang/cmake/modules/FindFlangQuadmath.cmake b/flang/cmake/modules/FindFlangQuadmath.cmake
new file mode 100644
index 00000000000000..38370cbba9e2fe
--- /dev/null
+++ b/flang/cmake/modules/FindFlangQuadmath.cmake
@@ -0,0 +1,62 @@
+#===-- cmake/modules/FindFlangQuadmath.cmake ---------------------===#
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===------------------------------------------------------------------------===#
+
+include(CheckIncludeFile)
+include(CMakePushCheckState)
+
+# Discover the GCC installation, when the build compiler is Clang,
+# and try to find quadmath.h there. Set FLANG_EVALUATE_INCLUDE_QUADMATH_H
+# to the path to quadmath.h, if found.
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if (NOT DEFINED FLANG_EVALUATE_GCC_RESOURCE_DIR)
+ set(FLANG_EVALUATE_GCC_RESOURCE_DIR
+ "FLANG_EVALUATE_GCC_RESOURCE_DIR-NOTFOUND")
+ # Prepare CMAKE_CXX_FLAGS so that they can be passed to execute_process
+ # as separate flags.
+ separate_arguments(flags UNIX_COMMAND "${CMAKE_CXX_FLAGS}")
+ execute_process(
+ COMMAND "${CMAKE_CXX_COMPILER}" ${flags} -v "-###"
+ ERROR_FILE "${CMAKE_CURRENT_BINARY_DIR}/clang_gcc_root_result"
+ )
+ file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/clang_gcc_root_result"
+ _errorresult)
+ foreach (_line IN LISTS _errorresult)
+ string(REGEX MATCH
+ "^Selected GCC installation: (.+)$"
+ _match
+ "${_line}")
+ if (CMAKE_MATCH_1)
+ set(FLANG_EVALUATE_GCC_RESOURCE_DIR "${CMAKE_MATCH_1}")
+ message(STATUS
+ "Found GCC installation selected by Clang: ${FLANG_EVALUATE_GCC_RESOURCE_DIR}")
+ break()
+ endif ()
+ endforeach ()
+ set(FLANG_EVALUATE_GCC_RESOURCE_DIR
+ "${FLANG_EVALUATE_GCC_RESOURCE_DIR}" CACHE INTERNAL
+ "Path to GCC's resource dir selected by Clang for Flang constant folding"
+ FORCE)
+ endif ()
+endif ()
+
+check_include_file("quadmath.h" FLANG_EVALUATE_FOUND_QUADMATH_H)
+if (FLANG_EVALUATE_FOUND_QUADMATH_H)
+ message(STATUS "quadmath.h found without additional include paths")
+ set(FLANG_EVALUATE_INCLUDE_QUADMATH_H "<quadmath.h>")
+elseif (FLANG_EVALUATE_GCC_RESOURCE_DIR)
+ cmake_push_check_state()
+ list(APPEND CMAKE_REQUIRED_INCLUDES
+ "${FLANG_EVALUATE_GCC_RESOURCE_DIR}/include")
+ check_include_file("quadmath.h" FLANG_EVALUATE_FOUND_GCC_QUADMATH_H)
+ cmake_pop_check_state()
+ if (FLANG_EVALUATE_FOUND_GCC_QUADMATH_H)
+ message(STATUS "quadmath.h found in Clang's selected GCC installation")
+ set(FLANG_EVALUATE_INCLUDE_QUADMATH_H
+ "\"${FLANG_EVALUATE_GCC_RESOURCE_DIR}/include/quadmath.h\"")
+ endif ()
+endif ()
diff --git a/flang/cmake/quadmath_wrapper.h.in b/flang/cmake/quadmath_wrapper.h.in
index da08ec1230ada3..0e739f9f97a238 100644
--- a/flang/cmake/quadmath_wrapper.h.in
+++ b/flang/cmake/quadmath_wrapper.h.in
@@ -16,7 +16,7 @@
#pragma clang diagnostic ignored "-Wc99-extensions"
#endif
-#include ${FLANG_INCLUDE_QUADMATH_H}
+#include ${FLANG_EVALUATE_INCLUDE_QUADMATH_H}
#ifdef __clang_major__
#pragma clang diagnostic pop
diff --git a/flang/docs/GettingStarted.md b/flang/docs/GettingStarted.md
index 98620e6eafb072..5858617ff91ea1 100644
--- a/flang/docs/GettingStarted.md
+++ b/flang/docs/GettingStarted.md
@@ -310,13 +310,10 @@ commodity machines.
### Build options
-One may provide optional CMake variables to customize the build. Available options:
-
-* `-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath`: enables build of
- `flang_rt.quadmath` library that provides `REAL(16)` math APIs
- for intrinsics such as `SIN`, `COS`, etc. GCC `libquadmath`'s header file
- `quadmath.h` must be available to the build compiler.
- [More details](Real16MathSupport.md).
+Flang-RT's `REAL(16)` math provider can be selected with the
+`FLANG_RUNTIME_F128_MATH_LIB` CMake variable. See
+[Flang support for REAL(16)](Real16MathSupport.md) for the available providers
+and their linking requirements.
## Supported C++ compilers
@@ -487,4 +484,3 @@ It will generate html in
```bash
$BROWSER <build-dir>/tools/flang/docs/html/
```
-
diff --git a/flang/docs/Real16MathSupport.md b/flang/docs/Real16MathSupport.md
index d1005829461e1d..bc43da6fa84a69 100644
--- a/flang/docs/Real16MathSupport.md
+++ b/flang/docs/Real16MathSupport.md
@@ -12,14 +12,19 @@ To support most `REAL(16)` (i.e. 128-bit float) math intrinsics Flang relies
on third-party libraries providing the implementation.
`-DFLANG_RUNTIME_F128_MATH_LIB=libquadmath` CMake option can be used
-to build `libflang_rt.quadmath` library that has unresolved references
-to GCC `libquadmath` library. A Flang driver built with this option
-will automatically link `libflang_rt.quadmath` and `libquadmath` libraries
-to any Fortran program. This implies that `libquadmath` library
-has to be available in the standard library paths, so that linker
+when building Flang-RT to provide math entry points in `libflang_rt.quadmath`
+that have unresolved references to GCC `libquadmath` library.
+The Flang driver automatically links `libflang_rt.quadmath`, but does not
+automatically link `libquadmath`. Programs that require its functions must
+be linked with `-lquadmath`. This implies that `libquadmath` library
+has to be available in the library search paths, so that linker
can find it. The `libquadmath` library installation into Flang project
distribution is not automatic in CMake currently.
+`libflang_rt.quadmath` is built even without a math provider, but then
+contains no math entry points. For MSVC targets, the sources are instead
+included in `flang_rt.runtime` and no separate quadmath archive is built.
+
Testing shows that `libquadmath` versions before GCC-9.3.0 have
accuracy issues, so it is recommended to distribute the Flang
package with later versions of `libquadmath`.
@@ -31,16 +36,27 @@ of `libquadmath` to the Flang users' programs may imply some
restrictions/requirements. This document is not intended to give
any legal advice on distributing such a Flang compiler.
-Flang compiler targeting systems with `LDBL_MANT_DIG == 113`
+Flang-RT targeting systems with `LDBL_MANT_DIG == 113`
may provide `REAL(16)` math support without a `libquadmath`
-dependency, using standard `libc` APIs for the `long double`
+dependency, using standard `libm` APIs for the `long double`
data type. It is not recommended to use the above CMake option
-for building Flang compilers for such targets.
-
-In addition to the runtime library support described above, Flang may
-also consider `REAL(16)` available when the LLVM backend supports the
-target's 128-bit floating-point type. This check is independent of the
-availability of libraries implementing `REAL(16)` math intrinsics.
+for building Flang-RT for such targets.
+
+Flang considers `REAL(16)` available when the LLVM backend reports that the
+target's 128-bit floating-point type is legal, or provides libcall names for
+addition, subtraction, multiplication, and division. This check is independent
+of the availability of libraries implementing `REAL(16)` math intrinsics.
+Libcall names do not guarantee that the corresponding implementations exist.
+
+When bootstrapping with Flang, the LLVM runtimes build assumes that the
+Fortran compiler supports `REAL(16)` when a math provider is explicitly
+selected, for AArch64 and x86-64 targets, or for native targets whose C
+`long double` has 113 significand bits. In other cases, no setting is added.
+An explicit `FORTRAN_SUPPORTS_REAL16` setting takes precedence.
+This avoids probing an unfinished compiler for the cases above.
+A standalone Flang-RT build instead checks the Fortran compiler unless
+`FORTRAN_SUPPORTS_REAL16` is explicitly supplied. The bootstrap assumption
+does not ensure that a math provider is available.
As a result, `REAL(16)` variables and arithmetic operations may be accepted
even when no library support for `REAL(16)` math intrinsics is available.
diff --git a/flang/lib/Evaluate/CMakeLists.txt b/flang/lib/Evaluate/CMakeLists.txt
index 472ecb6d8d079b..c9754e0bc572e7 100644
--- a/flang/lib/Evaluate/CMakeLists.txt
+++ b/flang/lib/Evaluate/CMakeLists.txt
@@ -22,7 +22,7 @@ if (LIBPGMATH_DIR)
endif()
check_library_exists(quadmath sinq "" FOUND_QUADMATH_LIB)
-if (FLANG_INCLUDE_QUADMATH_H AND FOUND_QUADMATH_LIB)
+if (FLANG_EVALUATE_INCLUDE_QUADMATH_H AND FOUND_QUADMATH_LIB)
configure_file("${FLANG_SOURCE_DIR}/cmake/quadmath_wrapper.h.in" "${CMAKE_CURRENT_BINARY_DIR}/quadmath_wrapper.h")
add_compile_definitions(HAS_QUADMATHLIB)
set(QUADMATHLIB quadmath)
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index a139af9a29e57a..59315be83f6302 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -960,20 +960,13 @@ prettyPrintIntrinsicName(fir::FirOpBuilder &builder, mlir::Location loc,
// Generate a call to the Fortran runtime library providing
// support for 128-bit float math.
-// On 'HAS_LDBL128' targets the implementation
-// is provided by flang_rt, otherwise, it is done via the
-// libflang_rt.quadmath library. In the latter case the compiler
-// has to be built with FLANG_RUNTIME_F128_MATH_LIB to guarantee
-// proper linking actions in the driver.
+// The implementation is provided by flang_rt or libflang_rt.quadmath,
+// depending on the target.
static mlir::Value genLibF128Call(fir::FirOpBuilder &builder,
mlir::Location loc,
const MathOperation &mathOp,
mlir::FunctionType libFuncType,
llvm::ArrayRef<mlir::Value> args) {
- // TODO: if we knew that the C 'long double' does not have 113-bit mantissa
- // on the target, we could have asserted that FLANG_RUNTIME_F128_MATH_LIB
- // must be specified. For now just always generate the call even
- // if it will be unresolved.
return genLibCall(builder, loc, mathOp, libFuncType, args);
}
diff --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90
index c4e0012b5c224d..e613fd854e010f 100644
--- a/flang/test/Driver/linker-flags.f90
+++ b/flang/test/Driver/linker-flags.f90
@@ -2,15 +2,15 @@
! invocation. These libraries are added on top of other standard runtime
! libraries that the Clang driver will include.
-! RUN: %flang -### --target=ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
-! RUN: %flang -### --target=sparc-sun-solaris2.11 %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,SOLARIS-F128%f128-lib
-! RUN: %flang -### --target=x86_64-unknown-freebsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
-! RUN: %flang -### --target=x86_64-unknown-netbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
-! RUN: %flang -### --target=x86_64-unknown-openbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
-! RUN: %flang -### --target=x86_64-unknown-dragonfly %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
-! RUN: %flang -### --target=aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN,DARWIN-F128%f128-lib
-! RUN: %flang -### --target=x86_64-unknown-haiku %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,HAIKU,HAIKU-F128%f128-lib
-! RUN: %flang -### --target=x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW,MINGW-F128%f128-lib
+! RUN: %flang -### --target=ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX
+! RUN: %flang -### --target=sparc-sun-solaris2.11 %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX
+! RUN: %flang -### --target=x86_64-unknown-freebsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD
+! RUN: %flang -### --target=x86_64-unknown-netbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD
+! RUN: %flang -### --target=x86_64-unknown-openbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD
+! RUN: %flang -### --target=x86_64-unknown-dragonfly %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD
+! RUN: %flang -### --target=aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN
+! RUN: %flang -### --target=x86_64-unknown-haiku %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,HAIKU
+! RUN: %flang -### --target=x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW
! RUN: %flang -### -rtlib=compiler-rt --target=aarch64-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s \
! RUN: --check-prefixes=CHECK,UNIX,COMPILER-RT,%if default-unwindlib=libgcc %{DEFAULT-UNWIND-LIBGCC%} %else %{%if default-unwindlib=libunwind %{DEFAULT-UNWIND-LIBUNWIND%} %else %{NO-DEFAULT-UNWIND%}%}
@@ -41,40 +41,38 @@
! executable and may find the GNU linker from MinGW or Cygwin.
! UNIX-LABEL: "{{.*}}ld{{(\.exe)?}}"
! UNIX-SAME: "[[object_file]]"
-! UNIX-F128NONE-NOT: lang_rt.quadmath
-! SOLARIS-F128NONE-NOT: flang_rt.quadmath
-! UNIX-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
-! SOLARIS-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "-z" "ignore" "-lquadmath" "-z" "record"
+! UNIX-SAME: "-lflang_rt.quadmath"
+! UNIX-NOT: "-lquadmath"
! UNIX-SAME: "-lflang_rt.runtime" "-lm"
! COMPILER-RT: "{{.*}}{{\\|/}}libclang_rt.builtins.a"
! UNIX-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"
! BSD-LABEL: "{{.*}}ld{{(\.exe)?}}"
! BSD-SAME: "[[object_file]]"
-! BSD-F128NONE-NOT: flang_rt.quadmath
-! BSD-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
+! BSD-SAME: "-lflang_rt.quadmath"
+! BSD-NOT: "-lquadmath"
! BSD-SAME: -lflang_rt.runtime
! BSD-SAME: -lexecinfo
! BSD-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"
! DARWIN-LABEL: "{{.*}}ld{{(\.exe)?}}"
! DARWIN-SAME: "[[object_file]]"
-! DARWIN-F128NONE-NOT: libflang_rt.quadmath
-! DARWIN-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
+! DARWIN-SAME: "-lflang_rt.quadmath"
+! DARWIN-NOT: "-lquadmath"
! DARWIN-SAME: -lflang_rt.runtime
! DARWIN-STATIC-FLANGRT: "{{.*}}{{\\|/}}libclang_rt.runtime_osx.a"
! HAIKU-LABEL: "{{.*}}ld{{(\.exe)?}}"
! HAIKU-SAME: "[[object_file]]"
-! HAIKU-F128NONE-NOT: libflang_rt.quadmath
-! HAIKU-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
+! HAIKU-SAME: "-lflang_rt.quadmath"
+! HAIKU-NOT: "-lquadmath"
! HAIKU-SAME: "-lflang_rt.runtime"
! HAIKU-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"
! MINGW-LABEL: "{{.*}}ld{{(\.exe)?}}"
! MINGW-SAME: "[[object_file]]"
-! MINGW-F128NONE-NOT: libflang_rt.quadmath
-! MINGW-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"
+! MINGW-SAME: "-lflang_rt.quadmath"
+! MINGW-NOT: "-lquadmath"
! MINGW-SAME: -lflang_rt.runtime
! MINGW-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"
diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp
index 2e301e0daaba81..1c324b73b94ac8 100644
--- a/flang/tools/flang-driver/driver.cpp
+++ b/flang/tools/flang-driver/driver.cpp
@@ -162,9 +162,6 @@ int main(int argc, const char **argv) {
"flang LLVM compiler");
theDriver.setTargetAndMode(targetandMode);
theDriver.setPreferredLinker(FLANG_DEFAULT_LINKER);
-#ifdef FLANG_RUNTIME_F128_MATH_LIB
- theDriver.setFlangF128MathLibrary(FLANG_RUNTIME_F128_MATH_LIB);
-#endif
std::unique_ptr<clang::driver::Compilation> c(
theDriver.BuildCompilation(args));
llvm::SmallVector<std::pair<int, const clang::driver::Command *>, 4>
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 3f19fd31f1a65b..0d3d5cc9353cd0 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -276,6 +276,40 @@ foreach(entry ${runtimes})
list(APPEND RUNTIME_NAMES ${name})
endforeach()
+function(runtime_get_real16_cmake_args target result)
+ set(${result} "" PARENT_SCOPE)
+ set(math_lib "${FLANG_RUNTIME_F128_MATH_LIB}")
+ foreach(arg IN LISTS ARGN)
+ if(arg MATCHES "^-DFORTRAN_SUPPORTS_REAL16(:[^=]+)?=")
+ return()
+ elseif(arg MATCHES "^-DFLANG_RUNTIME_F128_MATH_LIB(:[^=]+)?=(.*)$")
+ set(math_lib "${CMAKE_MATCH_2}")
+ endif()
+ endforeach()
+ if(DEFINED FORTRAN_SUPPORTS_REAL16)
+ set(${result} "-DFORTRAN_SUPPORTS_REAL16=${FORTRAN_SUPPORTS_REAL16}" PARENT_SCOPE)
+ return()
+ endif()
+
+ # fakeflang cannot probe REAL(16) before the bootstrap compiler exists.
+ if(math_lib OR target MATCHES "^(aarch64|x86_64)(-|$)")
+ set(${result} -DFORTRAN_SUPPORTS_REAL16=ON PARENT_SCOPE)
+ elseif(target STREQUAL LLVM_HOST_TRIPLE)
+ include(CheckCSourceCompiles)
+ check_c_source_compiles(
+ "#include <float.h>
+ #if LDBL_MANT_DIG != 113
+ #error LDBL_MANT_DIG != 113
+ #endif
+ int main() { return 0; }
+ "
+ HAVE_LDBL_MANT_DIG_113)
+ if(HAVE_LDBL_MANT_DIG_113)
+ set(${result} -DFORTRAN_SUPPORTS_REAL16=ON PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
function(runtime_default_target)
cmake_parse_arguments(ARG "" "" "DEPENDS;CMAKE_ARGS;PREFIXES;EXTRA_ARGS" ${ARGN})
@@ -333,6 +367,13 @@ function(runtime_default_target)
set_enable_per_target_runtime_dir()
+ if("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES AND
+ "ENABLE_FORTRAN" IN_LIST ARG_EXTRA_ARGS AND TARGET flang-lazy)
+ runtime_get_real16_cmake_args("${LLVM_TARGET_TRIPLE}" real16_cmake_args
+ ${COMMON_CMAKE_ARGS} ${RUNTIMES_CMAKE_ARGS} ${ARG_CMAKE_ARGS})
+ list(APPEND ARG_CMAKE_ARGS ${real16_cmake_args})
+ endif()
+
llvm_ExternalProject_Add(runtimes
${CMAKE_CURRENT_SOURCE_DIR}/../../runtimes
DEPENDS ${ARG_DEPENDS}
@@ -387,6 +428,11 @@ function(runtime_register_target name)
endif()
endforeach()
+ if("flang-rt" IN_LIST runtime_names AND TARGET flang-lazy AND
+ NOT "ENABLE_FORTRAN" IN_LIST ARG_EXTRA_ARGS)
+ list(APPEND ARG_EXTRA_ARGS ENABLE_FORTRAN)
+ endif()
+
foreach(runtime_name ${runtime_names})
set(${runtime_name}-${name} ${runtime_name})
set(install-${runtime_name}-${name} install-${runtime_name})
@@ -455,6 +501,18 @@ function(runtime_register_target name)
list(APPEND ${name}_extra_args -DLLVM_USE_LINKER=${LLVM_USE_LINKER})
append_passthrough_options(${name}_extra_args RUNTIMES "${ARG_BASE_NAME};${name}")
+ if(ARG_BASE_NAME)
+ set(runtime_target_triple "${ARG_BASE_NAME}")
+ else()
+ set(runtime_target_triple "${name}")
+ endif()
+ if("flang-rt" IN_LIST runtime_names AND
+ "ENABLE_FORTRAN" IN_LIST ARG_EXTRA_ARGS AND TARGET flang-lazy)
+ runtime_get_real16_cmake_args("${runtime_target_triple}" real16_cmake_args
+ ${COMMON_CMAKE_ARGS} ${${name}_extra_args})
+ list(APPEND ${name}_extra_args ${real16_cmake_args})
+ endif()
+
set_enable_per_target_runtime_dir()
llvm_ExternalProject_Add(runtimes-${name}
@@ -525,17 +583,6 @@ function(runtime_register_target name)
add_flang_mod_deps(runtimes-${name}-build ${${name}_extra_targets})
endfunction()
-# Determine whether REAL(16) intrinsic modules should be built for the target.
-function(check_real16_support target result)
- if(FLANG_RUNTIME_F128_MATH_LIB
- OR HAVE_LDBL_MANT_DIG_113
- OR target MATCHES "^(x86_64|aarch64)")
- set(${result} TRUE PARENT_SCOPE)
- else()
- set(${result} FALSE PARENT_SCOPE)
- endif()
-endfunction()
-
# Check if we have any runtimes to build.
if(runtimes)
set(build_runtimes TRUE)
@@ -677,34 +724,21 @@ if(build_runtimes)
if(LLVM_LIBC_FULL_BUILD)
list(APPEND extra_cmake_args "-DLLVM_LIBC_FULL_BUILD=ON")
endif()
+ if(DEFINED FLANG_RUNTIME_F128_MATH_LIB)
+ list(APPEND extra_cmake_args
+ "-DFLANG_RUNTIME_F128_MATH_LIB=${FLANG_RUNTIME_F128_MATH_LIB}")
+ endif()
if("flang" IN_LIST LLVM_ENABLE_PROJECTS)
# Allow runtimes that can use it to access the Flang compiler
if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES OR "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
list(APPEND extra_args ENABLE_FORTRAN)
endif()
- # Ensure REAL(16) support in runtimes to be consistent with compiler.
- # Keep intrinsic module generation consistent with targets for which
- # the Flang frontend currently enables REAL(16) through backend support.
- if(LLVM_RUNTIME_TARGETS)
- foreach(name ${LLVM_RUNTIME_TARGETS})
- if(name STREQUAL "default")
- check_real16_support("${LLVM_TARGET_TRIPLE}" supports_real16)
- set(default_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
- else()
- check_real16_support("${name}" supports_real16)
- set(${name}_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
- endif()
- endforeach()
- else()
- check_real16_support("${LLVM_TARGET_TRIPLE}" supports_real16)
- set(default_fortran_cmake_args "-DFORTRAN_SUPPORTS_REAL16=${supports_real16}")
- endif()
endif()
if(NOT LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
- CMAKE_ARGS ${extra_cmake_args} ${default_fortran_cmake_args}
+ CMAKE_ARGS ${extra_cmake_args}
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
set(test_targets check-runtimes)
@@ -712,7 +746,7 @@ if(build_runtimes)
if("default" IN_LIST LLVM_RUNTIME_TARGETS)
runtime_default_target(
DEPENDS ${builtins_dep} ${extra_deps}
- CMAKE_ARGS ${extra_cmake_args} ${default_fortran_cmake_args}
+ CMAKE_ARGS ${extra_cmake_args}
PREFIXES ${prefixes}
EXTRA_ARGS ${extra_args})
list(REMOVE_ITEM LLVM_RUNTIME_TARGETS "default")
@@ -771,7 +805,7 @@ if(build_runtimes)
runtime_register_target(${name}
DEPENDS ${builtins_dep_name} ${extra_deps}
- CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args} ${${name}_fortran_cmake_args}
+ CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
endforeach()
>From 2da1b10d2a8aa14f653041e75f1c31283161992c Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Tue, 24 Nov 2026 14:30:22 +0900
Subject: [PATCH 10/11] Explain the quadmath placeholder source
---
flang-rt/lib/quadmath/unsupported.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/flang-rt/lib/quadmath/unsupported.cpp b/flang-rt/lib/quadmath/unsupported.cpp
index b12daf2924de68..93967efc2da1d2 100644
--- a/flang-rt/lib/quadmath/unsupported.cpp
+++ b/flang-rt/lib/quadmath/unsupported.cpp
@@ -5,3 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
+
+// Provide a source file for the quadmath archive when no math provider is
+// available. The archive then contains no math entry points.
>From 5d9a6bb21b5157374047ce3952daa1256bda189d Mon Sep 17 00:00:00 2001
From: s-watanabe314 <watanabe.shu-06 at fujitsu.com>
Date: Tue, 24 Nov 2026 14:21:51 +0900
Subject: [PATCH 11/11] Keep the existing REAL(16) lit feature name
Detect frontend support for the configured target and report the result while retaining the existing test feature name.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
---
flang/test/Evaluate/fold-out_of_range.f90 | 2 +-
flang/test/Evaluate/folding07.f90 | 2 +-
flang/test/Evaluate/rewrite-out_of_range.F90 | 2 +-
flang/test/Integration/abi-indirect-call.f90 | 2 +-
flang/test/Integration/common-block.f90 | 2 +-
.../test/Integration/complex-div-to-llvm-kind16.f90 | 2 +-
flang/test/Integration/debug-complex-1.f90 | 2 +-
flang/test/Integration/real-descriptors.f90 | 2 +-
.../test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90 | 2 +-
flang/test/Lower/HLFIR/convert-variable.f90 | 2 +-
flang/test/Lower/Intrinsics/abs.f90 | 2 +-
flang/test/Lower/Intrinsics/acos_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/acos_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/acosd.f90 | 2 +-
flang/test/Lower/Intrinsics/acosh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/acosh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/acospi.f90 | 2 +-
flang/test/Lower/Intrinsics/aint_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/anint_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/asin_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/asin_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/asind.f90 | 2 +-
flang/test/Lower/Intrinsics/asinh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/asinh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/asinpi.f90 | 2 +-
flang/test/Lower/Intrinsics/atan2_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atan2pi.f90 | 2 +-
flang/test/Lower/Intrinsics/atan_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/atan_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atand.f90 | 2 +-
flang/test/Lower/Intrinsics/atanh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/atanh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/atanpi.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_j0_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_j1_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_jn_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_y0_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_y1_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/bessel_yn_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cabs_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/ceiling_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cos_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/cos_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cosd.f90 | 2 +-
flang/test/Lower/Intrinsics/cosh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/cosh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/cospi.f90 | 2 +-
flang/test/Lower/Intrinsics/dot_product.f90 | 2 +-
flang/test/Lower/Intrinsics/erf_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/erfc_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/erfc_scaled_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/exp_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/exp_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/exponent.f90 | 2 +-
flang/test/Lower/Intrinsics/fast-real-mod.f90 | 10 +++++-----
flang/test/Lower/Intrinsics/floor_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/fma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/fraction.f90 | 2 +-
flang/test/Lower/Intrinsics/gamma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/hypot_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/ieee_class_queries.f90 | 2 +-
flang/test/Lower/Intrinsics/ieee_is_normal.f90 | 2 +-
flang/test/Lower/Intrinsics/ieee_next.f90 | 2 +-
flang/test/Lower/Intrinsics/ieee_unordered.f90 | 2 +-
flang/test/Lower/Intrinsics/isnan.f90 | 2 +-
flang/test/Lower/Intrinsics/log10_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/log_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/log_gamma_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/log_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/mod.f90 | 2 +-
flang/test/Lower/Intrinsics/modulo.f90 | 2 +-
flang/test/Lower/Intrinsics/nearest.f90 | 2 +-
flang/test/Lower/Intrinsics/nint_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/norm2.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_complex16i.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_complex16k.f90 | 2 +-
flang/test/Lower/Intrinsics/pow_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/powi_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/random_number_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/reduce.f90 | 2 +-
flang/test/Lower/Intrinsics/rrspacing.f90 | 2 +-
flang/test/Lower/Intrinsics/scale.f90 | 2 +-
flang/test/Lower/Intrinsics/set_exponent.f90 | 2 +-
flang/test/Lower/Intrinsics/sign.f90 | 2 +-
flang/test/Lower/Intrinsics/sin_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sin_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/sind.f90 | 2 +-
flang/test/Lower/Intrinsics/sinh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sinh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/sinpi.f90 | 2 +-
flang/test/Lower/Intrinsics/sqrt_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/sqrt_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tan_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/tan_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tand.f90 | 2 +-
flang/test/Lower/Intrinsics/tanh_complex16.f90 | 2 +-
flang/test/Lower/Intrinsics/tanh_real16.f90 | 2 +-
flang/test/Lower/Intrinsics/tanpi.f90 | 2 +-
.../OpenMP/parallel-firstprivate-clause-scalar.f90 | 2 +-
flang/test/Lower/assignment.f90 | 2 +-
flang/test/Lower/basic-function.f90 | 2 +-
flang/test/Lower/complex-operations.f90 | 2 +-
flang/test/Lower/math-lowering/abs.f90 | 12 ++++++------
flang/test/Lower/math-lowering/sign.f90 | 6 +++---
flang/test/Lower/real-operations-1.f90 | 2 +-
flang/test/Semantics/data05.f90 | 2 +-
flang/test/Semantics/intrinsics01.f90 | 2 +-
flang/test/Semantics/kinds03.f90 | 2 +-
flang/test/Semantics/modfile12.f90 | 2 +-
flang/test/Semantics/modfile26.f90 | 2 +-
flang/test/Semantics/realkinds-aarch64-01.f90 | 2 +-
flang/test/Semantics/realkinds-systemz-01.f90 | 2 +-
flang/test/lit.cfg.py | 8 +++++---
114 files changed, 129 insertions(+), 127 deletions(-)
diff --git a/flang/test/Evaluate/fold-out_of_range.f90 b/flang/test/Evaluate/fold-out_of_range.f90
index 51bc957925e92c..9a1855627db180 100644
--- a/flang/test/Evaluate/fold-out_of_range.f90
+++ b/flang/test/Evaluate/fold-out_of_range.f90
@@ -2,7 +2,7 @@
! RUN: %python %S/test_folding.py %s %flang_fc1 -pedantic -triple x86_64-unknown-linux-gnu -fdefault-integer-8
! UNSUPPORTED: system-windows
! REQUIRES: target=x86_64{{.*}}
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! Tests folding of OUT_OF_RANGE().
module m
integer(1), parameter :: i1v(*) = [ -huge(1_1) - 1_1, huge(1_1) ]
diff --git a/flang/test/Evaluate/folding07.f90 b/flang/test/Evaluate/folding07.f90
index 5e9db3ebb40b42..af13dc3e641b9b 100644
--- a/flang/test/Evaluate/folding07.f90
+++ b/flang/test/Evaluate/folding07.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_folding.py %s %flang_fc1
! Test numeric model inquiry intrinsics
diff --git a/flang/test/Evaluate/rewrite-out_of_range.F90 b/flang/test/Evaluate/rewrite-out_of_range.F90
index 21bc586c2bb0ec..4555889fcc5a42 100644
--- a/flang/test/Evaluate/rewrite-out_of_range.F90
+++ b/flang/test/Evaluate/rewrite-out_of_range.F90
@@ -1,7 +1,7 @@
! Tests rewriting of OUT_OF_RANGE()
! REQUIRES: target=x86_64{{.*}}
! REQUIRES: system-linux
-! RUN: %flang_fc1 -fdebug-unparse -cpp %s 2>&1 | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{%if system-linux %{,CHECK-X86-64%}%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: %flang_fc1 -fdebug-unparse -cpp %s 2>&1 | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{%if system-linux %{,CHECK-X86-64%}%}%if flang-supports-f128-math %{,CHECK-KIND16%}
logical round
diff --git a/flang/test/Integration/abi-indirect-call.f90 b/flang/test/Integration/abi-indirect-call.f90
index b8a717b5173035..54a6adfb2c14a8 100644
--- a/flang/test/Integration/abi-indirect-call.f90
+++ b/flang/test/Integration/abi-indirect-call.f90
@@ -1,5 +1,5 @@
!REQUIRES: x86-registered-target
-!REQUIRES: flang-frontend-supports-f128
+!REQUIRES: flang-supports-f128-math
!RUN: %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
! Test ABI of indirect calls is properly implemented in the LLVM IR.
diff --git a/flang/test/Integration/common-block.f90 b/flang/test/Integration/common-block.f90
index 6428b869c01ddb..5ffdd7df886d28 100644
--- a/flang/test/Integration/common-block.f90
+++ b/flang/test/Integration/common-block.f90
@@ -6,7 +6,7 @@
! added to this directory and sub-directories.
!===----------------------------------------------------------------------===!
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc %s -o - | tco | FileCheck %s
! RUN: %flang -emit-llvm -S -mmlir -disable-external-name-interop %s -o - | FileCheck %s
diff --git a/flang/test/Integration/complex-div-to-llvm-kind16.f90 b/flang/test/Integration/complex-div-to-llvm-kind16.f90
index 817d7112d34365..caddea68772968 100644
--- a/flang/test/Integration/complex-div-to-llvm-kind16.f90
+++ b/flang/test/Integration/complex-div-to-llvm-kind16.f90
@@ -1,6 +1,6 @@
! Test lowering complex division to llvm ir according to options
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: export FILECHECK_OPTS="-DF128_ALIGN=%if target=s390x{{.*}} %{8%} %else %{16%}"
! RUN: %flang -fcomplex-arithmetic=improved -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,IMPRVD
! RUN: %flang -fcomplex-arithmetic=basic -S -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,BASIC
diff --git a/flang/test/Integration/debug-complex-1.f90 b/flang/test/Integration/debug-complex-1.f90
index f646358a166038..206efed2ba089e 100644
--- a/flang/test/Integration/debug-complex-1.f90
+++ b/flang/test/Integration/debug-complex-1.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
program mn
diff --git a/flang/test/Integration/real-descriptors.f90 b/flang/test/Integration/real-descriptors.f90
index 20712f350e6fa5..39380595a3428b 100644
--- a/flang/test/Integration/real-descriptors.f90
+++ b/flang/test/Integration/real-descriptors.f90
@@ -6,7 +6,7 @@
! added to this directory and sub-directories.
!===----------------------------------------------------------------------===!
-! RUN: bbc %s -o - | tco | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc %s -o - | tco | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: define void {{.*}}test_reals
subroutine test_reals(x2, x3, x4, x8, c2, c3, c4, c8)
diff --git a/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90 b/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
index 44226f24029431..0e04bd4a7a936b 100644
--- a/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
+++ b/flang/test/Lower/HLFIR/complex-div-to-hlfir-kind16.f90
@@ -1,6 +1,6 @@
! Test lowering of complex division according to options
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -complex-range=full -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,FULL
! RUN: bbc -complex-range=improved -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,IMPRVD
! RUN: bbc -complex-range=basic -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,BASIC
diff --git a/flang/test/Lower/HLFIR/convert-variable.f90 b/flang/test/Lower/HLFIR/convert-variable.f90
index 87878d84f04dd5..e68a4c77997538 100644
--- a/flang/test/Lower/HLFIR/convert-variable.f90
+++ b/flang/test/Lower/HLFIR/convert-variable.f90
@@ -1,5 +1,5 @@
! Test lowering of variables to fir.declare
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}
subroutine scalar_numeric(x)
integer :: x
diff --git a/flang/test/Lower/Intrinsics/abs.f90 b/flang/test/Lower/Intrinsics/abs.f90
index 44046fa05f0019..97c58631a13297 100644
--- a/flang/test/Lower/Intrinsics/abs.f90
+++ b/flang/test/Lower/Intrinsics/abs.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
+! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK,CMPLX,CMPLX-PRECISE,%if flang-supports-f128-math %{F128%} %else %{F64%}
! RUN: %flang_fc1 -emit-hlfir -mllvm --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-PRECISE"
! RUN: %flang_fc1 -emit-hlfir -mllvm --force-mlir-complex %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-FAST"
! RUN: %flang_fc1 -fapprox-func -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CMPLX,CMPLX-APPROX"
diff --git a/flang/test/Lower/Intrinsics/acos_complex16.f90 b/flang/test/Lower/Intrinsics/acos_complex16.f90
index dd23dcca9b2521..9e9d4f1487d56c 100644
--- a/flang/test/Lower/Intrinsics/acos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acos_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acos_real16.f90 b/flang/test/Lower/Intrinsics/acos_real16.f90
index 26045a092d717c..2a09bfe94a8013 100644
--- a/flang/test/Lower/Intrinsics/acos_real16.f90
+++ b/flang/test/Lower/Intrinsics/acos_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acosd.f90 b/flang/test/Lower/Intrinsics/acosd.f90
index 0de92c2d705afd..175a4902620b83 100644
--- a/flang/test/Lower/Intrinsics/acosd.f90
+++ b/flang/test/Lower/Intrinsics/acosd.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/acosh_complex16.f90 b/flang/test/Lower/Intrinsics/acosh_complex16.f90
index 2cab3aa45215b4..69a23fb0f8410e 100644
--- a/flang/test/Lower/Intrinsics/acosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/acosh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acosh_real16.f90 b/flang/test/Lower/Intrinsics/acosh_real16.f90
index 9a1f6f3f3acb24..de787e3d2b0fb7 100644
--- a/flang/test/Lower/Intrinsics/acosh_real16.f90
+++ b/flang/test/Lower/Intrinsics/acosh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/acospi.f90 b/flang/test/Lower/Intrinsics/acospi.f90
index 2cf7777096a655..75f50d0140e32c 100644
--- a/flang/test/Lower/Intrinsics/acospi.f90
+++ b/flang/test/Lower/Intrinsics/acospi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -emit-hlfir -mllvm --math-runtime=precise %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/aint_real16.f90 b/flang/test/Lower/Intrinsics/aint_real16.f90
index dec105b3a565e5..b8b80ea3097cf2 100644
--- a/flang/test/Lower/Intrinsics/aint_real16.f90
+++ b/flang/test/Lower/Intrinsics/aint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/anint_real16.f90 b/flang/test/Lower/Intrinsics/anint_real16.f90
index 1e4f32d8545929..677240dc41df0d 100644
--- a/flang/test/Lower/Intrinsics/anint_real16.f90
+++ b/flang/test/Lower/Intrinsics/anint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asin_complex16.f90 b/flang/test/Lower/Intrinsics/asin_complex16.f90
index f3d58cb5ab9f5b..43aea8bd3c4c0f 100644
--- a/flang/test/Lower/Intrinsics/asin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asin_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asin_real16.f90 b/flang/test/Lower/Intrinsics/asin_real16.f90
index 06556530e28e71..cb32d0a6af70dd 100644
--- a/flang/test/Lower/Intrinsics/asin_real16.f90
+++ b/flang/test/Lower/Intrinsics/asin_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asind.f90 b/flang/test/Lower/Intrinsics/asind.f90
index 27e0d2ada20ee0..8d6198f53e4b48 100644
--- a/flang/test/Lower/Intrinsics/asind.f90
+++ b/flang/test/Lower/Intrinsics/asind.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/asinh_complex16.f90 b/flang/test/Lower/Intrinsics/asinh_complex16.f90
index 2c4bb5e0f31dca..6826a27406f909 100644
--- a/flang/test/Lower/Intrinsics/asinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/asinh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asinh_real16.f90 b/flang/test/Lower/Intrinsics/asinh_real16.f90
index 556a37db232817..9ab16f19d933e6 100644
--- a/flang/test/Lower/Intrinsics/asinh_real16.f90
+++ b/flang/test/Lower/Intrinsics/asinh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/asinpi.f90 b/flang/test/Lower/Intrinsics/asinpi.f90
index 58c89f5b8378b5..5a3be166345973 100644
--- a/flang/test/Lower/Intrinsics/asinpi.f90
+++ b/flang/test/Lower/Intrinsics/asinpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/atan2_real16.f90 b/flang/test/Lower/Intrinsics/atan2_real16.f90
index 8ac81c4cf181a2..5d0bf3069342cb 100644
--- a/flang/test/Lower/Intrinsics/atan2_real16.f90
+++ b/flang/test/Lower/Intrinsics/atan2_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atan2pi.f90 b/flang/test/Lower/Intrinsics/atan2pi.f90
index 743910029eac94..30887c1d398be4 100644
--- a/flang/test/Lower/Intrinsics/atan2pi.f90
+++ b/flang/test/Lower/Intrinsics/atan2pi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
function test_real4(y, x)
diff --git a/flang/test/Lower/Intrinsics/atan_complex16.f90 b/flang/test/Lower/Intrinsics/atan_complex16.f90
index df4d5a401bef4d..08cd16025e5e20 100644
--- a/flang/test/Lower/Intrinsics/atan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atan_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atan_real16.f90 b/flang/test/Lower/Intrinsics/atan_real16.f90
index 63e8a96c08954e..2bad58cf35f77b 100644
--- a/flang/test/Lower/Intrinsics/atan_real16.f90
+++ b/flang/test/Lower/Intrinsics/atan_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atand.f90 b/flang/test/Lower/Intrinsics/atand.f90
index 3969cfe3cd187e..480bf5956f0619 100644
--- a/flang/test/Lower/Intrinsics/atand.f90
+++ b/flang/test/Lower/Intrinsics/atand.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/atanh_complex16.f90 b/flang/test/Lower/Intrinsics/atanh_complex16.f90
index 9576c0b3bdd313..bc57bdf58c2c89 100644
--- a/flang/test/Lower/Intrinsics/atanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/atanh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atanh_real16.f90 b/flang/test/Lower/Intrinsics/atanh_real16.f90
index b003fd16ea6a00..0d60aecd08e1bc 100644
--- a/flang/test/Lower/Intrinsics/atanh_real16.f90
+++ b/flang/test/Lower/Intrinsics/atanh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/atanpi.f90 b/flang/test/Lower/Intrinsics/atanpi.f90
index ecb90cfe9b642c..3f7642d35ffc80 100644
--- a/flang/test/Lower/Intrinsics/atanpi.f90
+++ b/flang/test/Lower/Intrinsics/atanpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: %flang_fc1 -mllvm --math-runtime=precise -emit-hlfir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
diff --git a/flang/test/Lower/Intrinsics/bessel_j0_real16.f90 b/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
index 58743474ec6c88..f1c07f6137d815 100644
--- a/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_j0_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_j1_real16.f90 b/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
index 581abd47bf97e6..c41e7b5246adea 100644
--- a/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_j1_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_jn_real16.f90 b/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
index 5035a2502d6b55..1ec9cc719a4182 100644
--- a/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_jn_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_y0_real16.f90 b/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
index f2c0dc297b22af..459d2f4e7315fa 100644
--- a/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_y0_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_y1_real16.f90 b/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
index c96674d6f3ebad..869b2dc2c961b8 100644
--- a/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_y1_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/bessel_yn_real16.f90 b/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
index 1d3d6eb5a18eaa..53be23ab82d1ae 100644
--- a/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
+++ b/flang/test/Lower/Intrinsics/bessel_yn_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cabs_real16.f90 b/flang/test/Lower/Intrinsics/cabs_real16.f90
index c83834cd5d1f29..c1ec0267c0f988 100644
--- a/flang/test/Lower/Intrinsics/cabs_real16.f90
+++ b/flang/test/Lower/Intrinsics/cabs_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ceiling_real16.f90 b/flang/test/Lower/Intrinsics/ceiling_real16.f90
index 471202fba91a47..21dc221d6b35c6 100644
--- a/flang/test/Lower/Intrinsics/ceiling_real16.f90
+++ b/flang/test/Lower/Intrinsics/ceiling_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cos_complex16.f90 b/flang/test/Lower/Intrinsics/cos_complex16.f90
index 3664097c443ec7..d5e1249745e00c 100644
--- a/flang/test/Lower/Intrinsics/cos_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cos_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cos_real16.f90 b/flang/test/Lower/Intrinsics/cos_real16.f90
index 7d0c38c434fde3..859d4a5671e8cb 100644
--- a/flang/test/Lower/Intrinsics/cos_real16.f90
+++ b/flang/test/Lower/Intrinsics/cos_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cosd.f90 b/flang/test/Lower/Intrinsics/cosd.f90
index b39b18747ffc3e..4dbd718a28d6c8 100644
--- a/flang/test/Lower/Intrinsics/cosd.f90
+++ b/flang/test/Lower/Intrinsics/cosd.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/cosh_complex16.f90 b/flang/test/Lower/Intrinsics/cosh_complex16.f90
index f9f6bb1f019e4e..f2f170d9ba277a 100644
--- a/flang/test/Lower/Intrinsics/cosh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/cosh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cosh_real16.f90 b/flang/test/Lower/Intrinsics/cosh_real16.f90
index 2ebad29d863b03..cab85365661efa 100644
--- a/flang/test/Lower/Intrinsics/cosh_real16.f90
+++ b/flang/test/Lower/Intrinsics/cosh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/cospi.f90 b/flang/test/Lower/Intrinsics/cospi.f90
index 2f9ffedd0fb042..5c612901d83027 100644
--- a/flang/test/Lower/Intrinsics/cospi.f90
+++ b/flang/test/Lower/Intrinsics/cospi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/dot_product.f90 b/flang/test/Lower/Intrinsics/dot_product.f90
index 67fc1ab0550781..62694a70555df5 100644
--- a/flang/test/Lower/Intrinsics/dot_product.f90
+++ b/flang/test/Lower/Intrinsics/dot_product.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 -emit-fir -O0 %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: %flang_fc1 -emit-fir -O0 %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! DOT_PROD
! CHECK-LABEL: dot_prod_int_default
diff --git a/flang/test/Lower/Intrinsics/erf_real16.f90 b/flang/test/Lower/Intrinsics/erf_real16.f90
index 08d22acfbaa1b4..e9cc6175c1284c 100644
--- a/flang/test/Lower/Intrinsics/erf_real16.f90
+++ b/flang/test/Lower/Intrinsics/erf_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/erfc_real16.f90 b/flang/test/Lower/Intrinsics/erfc_real16.f90
index 5fe3708da0146b..d63c4d80df043c 100644
--- a/flang/test/Lower/Intrinsics/erfc_real16.f90
+++ b/flang/test/Lower/Intrinsics/erfc_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90 b/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
index 089af27aebfe3e..15c22e6142611c 100644
--- a/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
+++ b/flang/test/Lower/Intrinsics/erfc_scaled_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exp_complex16.f90 b/flang/test/Lower/Intrinsics/exp_complex16.f90
index 9c730cf04d6db9..e40207815ab7c3 100644
--- a/flang/test/Lower/Intrinsics/exp_complex16.f90
+++ b/flang/test/Lower/Intrinsics/exp_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exp_real16.f90 b/flang/test/Lower/Intrinsics/exp_real16.f90
index 2d56871f38f6f3..aed7319a9eb2db 100644
--- a/flang/test/Lower/Intrinsics/exp_real16.f90
+++ b/flang/test/Lower/Intrinsics/exp_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/exponent.f90 b/flang/test/Lower/Intrinsics/exponent.f90
index 43f64bdcc1d6ed..f5f0603ee13c83 100644
--- a/flang/test/Lower/Intrinsics/exponent.f90
+++ b/flang/test/Lower/Intrinsics/exponent.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! EXPONENT
diff --git a/flang/test/Lower/Intrinsics/fast-real-mod.f90 b/flang/test/Lower/Intrinsics/fast-real-mod.f90
index 7ab2a9c14e3448..6ecbb9b03f7017 100644
--- a/flang/test/Lower/Intrinsics/fast-real-mod.f90
+++ b/flang/test/Lower/Intrinsics/fast-real-mod.f90
@@ -1,8 +1,8 @@
-! RUN: %flang_fc1 -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FRM-KIND16%}
-! RUN: %flang_fc1 -ffast-real-mod -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-NFRM-KIND16%}
-! RUN: %flang_fc1 -fno-fast-real-mod -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FRM-KIND16%}
-! RUN: %flang_fc1 -ffast-math -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FM%if target=x86_64{{.*}} %{,CHECK-FM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-FM-KIND16%}
-! RUN: %flang_fc1 -ffast-math -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-NFRM-KIND16%}
+! RUN: %flang_fc1 -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-supports-f128-math %{,CHECK-FRM-KIND16%}
+! RUN: %flang_fc1 -ffast-real-mod -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-supports-f128-math %{,CHECK-NFRM-KIND16%}
+! RUN: %flang_fc1 -fno-fast-real-mod -ffast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FRM%if target=x86_64{{.*}} %{,CHECK-FRM-KIND10%}%if flang-supports-f128-math %{,CHECK-FRM-KIND16%}
+! RUN: %flang_fc1 -ffast-math -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-FM%if target=x86_64{{.*}} %{,CHECK-FM-KIND10%}%if flang-supports-f128-math %{,CHECK-FM-KIND16%}
+! RUN: %flang_fc1 -ffast-math -fno-fast-real-mod -emit-mlir -o - %s | FileCheck %s --check-prefixes=CHECK-NFRM%if target=x86_64{{.*}} %{,CHECK-NFRM-KIND10%}%if flang-supports-f128-math %{,CHECK-NFRM-KIND16%}
! CHECK-FM: module attributes {{{.*}}fir.fast_real_mod = true{{.*}}}
! CHECK-FRM: module attributes {{{.*}}fir.fast_real_mod = true{{.*}}}
diff --git a/flang/test/Lower/Intrinsics/floor_real16.f90 b/flang/test/Lower/Intrinsics/floor_real16.f90
index 22c866332a6733..536c14106dd6f5 100644
--- a/flang/test/Lower/Intrinsics/floor_real16.f90
+++ b/flang/test/Lower/Intrinsics/floor_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/fma_real16.f90 b/flang/test/Lower/Intrinsics/fma_real16.f90
index 911acdac9daa10..ecc32635be9dcb 100644
--- a/flang/test/Lower/Intrinsics/fma_real16.f90
+++ b/flang/test/Lower/Intrinsics/fma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/fraction.f90 b/flang/test/Lower/Intrinsics/fraction.f90
index 02fdbb2c427875..594beb97cc5a3d 100644
--- a/flang/test/Lower/Intrinsics/fraction.f90
+++ b/flang/test/Lower/Intrinsics/fraction.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! FRACTION
diff --git a/flang/test/Lower/Intrinsics/gamma_real16.f90 b/flang/test/Lower/Intrinsics/gamma_real16.f90
index fa1ce52b4016ca..aabf7fb73f0b2a 100644
--- a/flang/test/Lower/Intrinsics/gamma_real16.f90
+++ b/flang/test/Lower/Intrinsics/gamma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/hypot_real16.f90 b/flang/test/Lower/Intrinsics/hypot_real16.f90
index 57311a67b696a5..753148ede29cd6 100644
--- a/flang/test/Lower/Intrinsics/hypot_real16.f90
+++ b/flang/test/Lower/Intrinsics/hypot_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ieee_class_queries.f90 b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
index a2b35379d8554d..8d20ff8f3178fe 100644
--- a/flang/test/Lower/Intrinsics/ieee_class_queries.f90
+++ b/flang/test/Lower/Intrinsics/ieee_class_queries.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! REQUIRES: x86-registered-target
! RUN: bbc -target x86_64-unknown-linux-gnu -emit-fir -o - %s | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/ieee_is_normal.f90 b/flang/test/Lower/Intrinsics/ieee_is_normal.f90
index 0395e007ef5691..d55b2e3c08561b 100644
--- a/flang/test/Lower/Intrinsics/ieee_is_normal.f90
+++ b/flang/test/Lower/Intrinsics/ieee_is_normal.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: ieee_is_normal_f16
subroutine ieee_is_normal_f16(r)
diff --git a/flang/test/Lower/Intrinsics/ieee_next.f90 b/flang/test/Lower/Intrinsics/ieee_next.f90
index 8e77bfee5f34b4..585becda908821 100644
--- a/flang/test/Lower/Intrinsics/ieee_next.f90
+++ b/flang/test/Lower/Intrinsics/ieee_next.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
module ieee_next_tests
use ieee_arithmetic, only: ieee_value, ieee_negative_inf, ieee_positive_inf
diff --git a/flang/test/Lower/Intrinsics/ieee_unordered.f90 b/flang/test/Lower/Intrinsics/ieee_unordered.f90
index 2354817f8dc648..e3c806bbd0b608 100644
--- a/flang/test/Lower/Intrinsics/ieee_unordered.f90
+++ b/flang/test/Lower/Intrinsics/ieee_unordered.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir -o - %s | FileCheck %s
! CHECK-LABEL: func @_QQmain
diff --git a/flang/test/Lower/Intrinsics/isnan.f90 b/flang/test/Lower/Intrinsics/isnan.f90
index 17c1a7089952ab..6535724b2ce3b6 100644
--- a/flang/test/Lower/Intrinsics/isnan.f90
+++ b/flang/test/Lower/Intrinsics/isnan.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: isnan_f32
subroutine isnan_f32(r)
diff --git a/flang/test/Lower/Intrinsics/log10_real16.f90 b/flang/test/Lower/Intrinsics/log10_real16.f90
index d13a1cf7c3ea06..3a6e1d1af91122 100644
--- a/flang/test/Lower/Intrinsics/log10_real16.f90
+++ b/flang/test/Lower/Intrinsics/log10_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_complex16.f90 b/flang/test/Lower/Intrinsics/log_complex16.f90
index ded9b4e0717246..600d7f9b7dc479 100644
--- a/flang/test/Lower/Intrinsics/log_complex16.f90
+++ b/flang/test/Lower/Intrinsics/log_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_gamma_real16.f90 b/flang/test/Lower/Intrinsics/log_gamma_real16.f90
index 35500c539f1569..771ec4e5d931dc 100644
--- a/flang/test/Lower/Intrinsics/log_gamma_real16.f90
+++ b/flang/test/Lower/Intrinsics/log_gamma_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/log_real16.f90 b/flang/test/Lower/Intrinsics/log_real16.f90
index 3038a6452a5230..a57b8cc8e96980 100644
--- a/flang/test/Lower/Intrinsics/log_real16.f90
+++ b/flang/test/Lower/Intrinsics/log_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/mod.f90 b/flang/test/Lower/Intrinsics/mod.f90
index 0c39b87f801f0a..a78344267fbb6e 100644
--- a/flang/test/Lower/Intrinsics/mod.f90
+++ b/flang/test/Lower/Intrinsics/mod.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! RUN: %flang_fc1 -emit-hlfir -fcheck-integer-mod-zero-divisor %s -o - | FileCheck %s --check-prefix=CHECK-MOD-ZERO
! CHECK-LABEL: func @_QPmod_testr4(
diff --git a/flang/test/Lower/Intrinsics/modulo.f90 b/flang/test/Lower/Intrinsics/modulo.f90
index 38085cb3d23e74..29ba1795506947 100644
--- a/flang/test/Lower/Intrinsics/modulo.f90
+++ b/flang/test/Lower/Intrinsics/modulo.f90
@@ -1,5 +1,5 @@
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL
-! RUN: %flang_fc1 -menable-no-infs -emit-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
+! RUN: %flang_fc1 -menable-no-infs -emit-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-supports-f128-math %{F128%} %else %{F64%}
! RUN: %flang_fc1 -emit-hlfir -fcheck-integer-mod-zero-divisor %s -o - | FileCheck %s -check-prefix=CHECK-MOD-ZERO
! ALL-LABEL: func @_QPmodulo_testr(
diff --git a/flang/test/Lower/Intrinsics/nearest.f90 b/flang/test/Lower/Intrinsics/nearest.f90
index f6112634b3eba6..e808b6a0c2f325 100644
--- a/flang/test/Lower/Intrinsics/nearest.f90
+++ b/flang/test/Lower/Intrinsics/nearest.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: c.func @_QPnearest_test1
! CHECK: %[[V_0:[0-9]+]] = fir.dummy_scope : !fir.dscope
diff --git a/flang/test/Lower/Intrinsics/nint_real16.f90 b/flang/test/Lower/Intrinsics/nint_real16.f90
index 90c934899567a8..c4bbacd0347c04 100644
--- a/flang/test/Lower/Intrinsics/nint_real16.f90
+++ b/flang/test/Lower/Intrinsics/nint_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/norm2.f90 b/flang/test/Lower/Intrinsics/norm2.f90
index 569bcca978f7f4..ec89caa51d1a5e 100644
--- a/flang/test/Lower/Intrinsics/norm2.f90
+++ b/flang/test/Lower/Intrinsics/norm2.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: func @_QPnorm2_test_4(
real(4) function norm2_test_4(a)
diff --git a/flang/test/Lower/Intrinsics/pow_complex16.f90 b/flang/test/Lower/Intrinsics/pow_complex16.f90
index b0bef4d6a6225c..c026dd242e964d 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16i.f90 b/flang/test/Lower/Intrinsics/pow_complex16i.f90
index f92218b7cae4d1..ea18d67b754600 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16i.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16i.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_complex16k.f90 b/flang/test/Lower/Intrinsics/pow_complex16k.f90
index 71f117faef275c..d2b70185bda9f3 100644
--- a/flang/test/Lower/Intrinsics/pow_complex16k.f90
+++ b/flang/test/Lower/Intrinsics/pow_complex16k.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/pow_real16.f90 b/flang/test/Lower/Intrinsics/pow_real16.f90
index 56682f81a65bf9..869422381401dc 100644
--- a/flang/test/Lower/Intrinsics/pow_real16.f90
+++ b/flang/test/Lower/Intrinsics/pow_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/powi_real16.f90 b/flang/test/Lower/Intrinsics/powi_real16.f90
index f6476c1a5db36a..dc19b32742c0b9 100644
--- a/flang/test/Lower/Intrinsics/powi_real16.f90
+++ b/flang/test/Lower/Intrinsics/powi_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-FAST
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-PRECISE
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefix=CHECK-FAST
diff --git a/flang/test/Lower/Intrinsics/random_number_real16.f90 b/flang/test/Lower/Intrinsics/random_number_real16.f90
index 6347830a548199..1597d9bd5397fc 100644
--- a/flang/test/Lower/Intrinsics/random_number_real16.f90
+++ b/flang/test/Lower/Intrinsics/random_number_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/reduce.f90 b/flang/test/Lower/Intrinsics/reduce.f90
index 21c7d07a5e36ea..20c705153b192a 100644
--- a/flang/test/Lower/Intrinsics/reduce.f90
+++ b/flang/test/Lower/Intrinsics/reduce.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
module reduce_mod
diff --git a/flang/test/Lower/Intrinsics/rrspacing.f90 b/flang/test/Lower/Intrinsics/rrspacing.f90
index 9bfcb767f6ffbe..5fc551ebf4464e 100644
--- a/flang/test/Lower/Intrinsics/rrspacing.f90
+++ b/flang/test/Lower/Intrinsics/rrspacing.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-hlfir %s -o - | FileCheck %s
! CHECK-LABEL: func @_QPrrspacing_test2(
diff --git a/flang/test/Lower/Intrinsics/scale.f90 b/flang/test/Lower/Intrinsics/scale.f90
index 7f212ac850b264..9034c48e639b59 100644
--- a/flang/test/Lower/Intrinsics/scale.f90
+++ b/flang/test/Lower/Intrinsics/scale.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! CHECK-LABEL: scale_test1
subroutine scale_test1(x, i)
diff --git a/flang/test/Lower/Intrinsics/set_exponent.f90 b/flang/test/Lower/Intrinsics/set_exponent.f90
index 0012b262836f86..a06be6aac44199 100644
--- a/flang/test/Lower/Intrinsics/set_exponent.f90
+++ b/flang/test/Lower/Intrinsics/set_exponent.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! SET_EXPONENT
! CHECK-LABEL: set_exponent_test_4
diff --git a/flang/test/Lower/Intrinsics/sign.f90 b/flang/test/Lower/Intrinsics/sign.f90
index 19d5d67fd32328..965bda3d5b8341 100644
--- a/flang/test/Lower/Intrinsics/sign.f90
+++ b/flang/test/Lower/Intrinsics/sign.f90
@@ -1,4 +1,4 @@
-! RUN: bbc %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}
+! RUN: bbc %s -o - | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}
! CHECK-LABEL: sign_testi
subroutine sign_testi(a, b, c)
diff --git a/flang/test/Lower/Intrinsics/sin_complex16.f90 b/flang/test/Lower/Intrinsics/sin_complex16.f90
index 66b57c3ec3309f..d170e6303192f4 100644
--- a/flang/test/Lower/Intrinsics/sin_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sin_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sin_real16.f90 b/flang/test/Lower/Intrinsics/sin_real16.f90
index 9c1593580099aa..d09c71fb03e26c 100644
--- a/flang/test/Lower/Intrinsics/sin_real16.f90
+++ b/flang/test/Lower/Intrinsics/sin_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sind.f90 b/flang/test/Lower/Intrinsics/sind.f90
index 2f190597164fd3..1fb063117eb8d9 100644
--- a/flang/test/Lower/Intrinsics/sind.f90
+++ b/flang/test/Lower/Intrinsics/sind.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/sinh_complex16.f90 b/flang/test/Lower/Intrinsics/sinh_complex16.f90
index 7e6f1c60830512..ff2bd3420ea149 100644
--- a/flang/test/Lower/Intrinsics/sinh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sinh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sinh_real16.f90 b/flang/test/Lower/Intrinsics/sinh_real16.f90
index 737382fe6d3206..79aa71940aff8a 100644
--- a/flang/test/Lower/Intrinsics/sinh_real16.f90
+++ b/flang/test/Lower/Intrinsics/sinh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sinpi.f90 b/flang/test/Lower/Intrinsics/sinpi.f90
index 58b497f161bcce..06699b7f8ea718 100644
--- a/flang/test/Lower/Intrinsics/sinpi.f90
+++ b/flang/test/Lower/Intrinsics/sinpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/Intrinsics/sqrt_complex16.f90 b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
index e10749cc02f8d2..7f30befe9cb871 100644
--- a/flang/test/Lower/Intrinsics/sqrt_complex16.f90
+++ b/flang/test/Lower/Intrinsics/sqrt_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/sqrt_real16.f90 b/flang/test/Lower/Intrinsics/sqrt_real16.f90
index debd67f9a3970e..ac08c8c79e9a84 100644
--- a/flang/test/Lower/Intrinsics/sqrt_real16.f90
+++ b/flang/test/Lower/Intrinsics/sqrt_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tan_complex16.f90 b/flang/test/Lower/Intrinsics/tan_complex16.f90
index a3572cc6c7d408..b6ed0bb4515b59 100644
--- a/flang/test/Lower/Intrinsics/tan_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tan_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tan_real16.f90 b/flang/test/Lower/Intrinsics/tan_real16.f90
index 14e57291abc77e..62aa403fe58ce3 100644
--- a/flang/test/Lower/Intrinsics/tan_real16.f90
+++ b/flang/test/Lower/Intrinsics/tan_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tand.f90 b/flang/test/Lower/Intrinsics/tand.f90
index 61b8818d90c63e..8c8927e6f5a991 100644
--- a/flang/test/Lower/Intrinsics/tand.f90
+++ b/flang/test/Lower/Intrinsics/tand.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-PRECISE"
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK,CHECK-FAST"
diff --git a/flang/test/Lower/Intrinsics/tanh_complex16.f90 b/flang/test/Lower/Intrinsics/tanh_complex16.f90
index fe1c1798f5ebfb..22e5b85bb3c098 100644
--- a/flang/test/Lower/Intrinsics/tanh_complex16.f90
+++ b/flang/test/Lower/Intrinsics/tanh_complex16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tanh_real16.f90 b/flang/test/Lower/Intrinsics/tanh_real16.f90
index 13e19578248f3c..aff7e7b31d7543 100644
--- a/flang/test/Lower/Intrinsics/tanh_real16.f90
+++ b/flang/test/Lower/Intrinsics/tanh_real16.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! RUN: bbc --math-runtime=precise -emit-fir %s -o - | FileCheck %s
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
diff --git a/flang/test/Lower/Intrinsics/tanpi.f90 b/flang/test/Lower/Intrinsics/tanpi.f90
index be08d176a3daa4..0a011047ce93e9 100644
--- a/flang/test/Lower/Intrinsics/tanpi.f90
+++ b/flang/test/Lower/Intrinsics/tanpi.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s --check-prefixes="CHECK"
function test_real4(x)
diff --git a/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90 b/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
index 01b2f25ae1ea21..6fb04c4abf9cc3 100644
--- a/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
+++ b/flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
@@ -2,7 +2,7 @@
! REQUIRES: x86-registered-target
! RUN: bbc -target x86_64-unknown-linux-gnu -fopenmp -emit-hlfir %s -o - \
-! RUN: | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
!CHECK: omp.private {type = firstprivate} @[[ARG2_LOGICAL_PRIVATIZER:_QFfirstprivate_logicalEarg2_firstprivate_l8]] : !fir.logical<1>
diff --git a/flang/test/Lower/assignment.f90 b/flang/test/Lower/assignment.f90
index 13b5c1755b93cd..cc732d5ae82c0c 100644
--- a/flang/test/Lower/assignment.f90
+++ b/flang/test/Lower/assignment.f90
@@ -1,4 +1,4 @@
-! RUN: %flang_fc1 %s -o "-" -emit-hlfir -cpp | FileCheck %s --check-prefixes=CHECK,%if flang-frontend-supports-f128 %{F128%} %else %{F64%}%if target=x86_64-unknown-linux{{.*}} %{,CHECK-X86-64%}
+! RUN: %flang_fc1 %s -o "-" -emit-hlfir -cpp | FileCheck %s --check-prefixes=CHECK,%if flang-supports-f128-math %{F128%} %else %{F64%}%if target=x86_64-unknown-linux{{.*}} %{,CHECK-X86-64%}
subroutine sub1(a)
integer :: a
diff --git a/flang/test/Lower/basic-function.f90 b/flang/test/Lower/basic-function.f90
index 55a5de0c438155..c250a988bf7b3c 100644
--- a/flang/test/Lower/basic-function.f90
+++ b/flang/test/Lower/basic-function.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
integer(1) function fct1()
end
diff --git a/flang/test/Lower/complex-operations.f90 b/flang/test/Lower/complex-operations.f90
index a6259bd199df24..17f1e6e1eb1773 100644
--- a/flang/test/Lower/complex-operations.f90
+++ b/flang/test/Lower/complex-operations.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! REQUIRES: x86-registered-target
! RUN: %flang_fc1 -emit-hlfir -triple x86_64-unknown-linux-gnu %s -o - | FileCheck %s
diff --git a/flang/test/Lower/math-lowering/abs.f90 b/flang/test/Lower/math-lowering/abs.f90
index a7e00715a9e751..9d3b8b92cfdd60 100644
--- a/flang/test/Lower/math-lowering/abs.f90
+++ b/flang/test/Lower/math-lowering/abs.f90
@@ -1,9 +1,9 @@
-! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST,FAST-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
-! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
-! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
-! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-frontend-supports-f128 %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=fast | FileCheck --check-prefixes=ALL,FAST-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=fast %s -o - | FileCheck --check-prefixes=ALL,FAST,FAST-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=relaxed | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=relaxed %s -o - | FileCheck --check-prefixes=ALL,RELAXED,RELAXED-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: bbc -emit-fir %s -o - --math-runtime=precise | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
+! RUN: %flang_fc1 -emit-fir -mllvm -math-runtime=precise %s -o - | FileCheck --check-prefixes=ALL,PRECISE,PRECISE-%if flang-supports-f128-math %{F128%} %else %{F64%} %s
function test_real4(x)
real :: x, test_real4
diff --git a/flang/test/Lower/math-lowering/sign.f90 b/flang/test/Lower/math-lowering/sign.f90
index fd15eca6b6b642..534a6679fbeff0 100644
--- a/flang/test/Lower/math-lowering/sign.f90
+++ b/flang/test/Lower/math-lowering/sign.f90
@@ -1,11 +1,11 @@
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=fast %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,FAST%if target=x86_64{{.*}} %{,ALL-KIND10,FAST-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,FAST-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,FAST%if target=x86_64{{.*}} %{,ALL-KIND10,FAST-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,FAST-KIND16%}
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=relaxed %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,RELAXED%if target=x86_64{{.*}} %{,ALL-KIND10,RELAXED-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,RELAXED-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,RELAXED%if target=x86_64{{.*}} %{,ALL-KIND10,RELAXED-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,RELAXED-KIND16%}
! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=precise %s \
-! RUN: | FileCheck %s --check-prefixes=ALL,PRECISE%if target=x86_64{{.*}} %{,ALL-KIND10,PRECISE-KIND10%}%if flang-frontend-supports-f128 %{,ALL-KIND16,PRECISE-KIND16%}
+! RUN: | FileCheck %s --check-prefixes=ALL,PRECISE%if target=x86_64{{.*}} %{,ALL-KIND10,PRECISE-KIND10%}%if flang-supports-f128-math %{,ALL-KIND16,PRECISE-KIND16%}
function test_real4(x, y)
real :: x, y, test_real4
diff --git a/flang/test/Lower/real-operations-1.f90 b/flang/test/Lower/real-operations-1.f90
index 0cb2d53eef7c1b..d155b7dc9570f5 100644
--- a/flang/test/Lower/real-operations-1.f90
+++ b/flang/test/Lower/real-operations-1.f90
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-frontend-supports-f128 %{,CHECK-KIND16%}
+! RUN: bbc -emit-hlfir %s -o - | FileCheck %s --check-prefixes=CHECK%if target=x86_64{{.*}} %{,CHECK-KIND10%}%if flang-supports-f128-math %{,CHECK-KIND16%}
! Test real add on real kinds.
! CHECK-LABEL: real2
diff --git a/flang/test/Semantics/data05.f90 b/flang/test/Semantics/data05.f90
index 2cfe15f572d1ce..c3591c1c5da8a2 100644
--- a/flang/test/Semantics/data05.f90
+++ b/flang/test/Semantics/data05.f90
@@ -1,4 +1,4 @@
-!REQUIRES: flang-frontend-supports-f128
+!REQUIRES: flang-supports-f128-math
!RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s
module m
interface
diff --git a/flang/test/Semantics/intrinsics01.f90 b/flang/test/Semantics/intrinsics01.f90
index eb24ea1a09929e..74778914fc7e5d 100644
--- a/flang/test/Semantics/intrinsics01.f90
+++ b/flang/test/Semantics/intrinsics01.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for semantic errors for DREAL, DIMAG, DCONJG intrinsics
diff --git a/flang/test/Semantics/kinds03.f90 b/flang/test/Semantics/kinds03.f90
index ca1e31272f41b9..12c7aaf88e2df1 100644
--- a/flang/test/Semantics/kinds03.f90
+++ b/flang/test/Semantics/kinds03.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_symbols.py %s %flang_fc1
!DEF: /MainProgram1/ipdt DerivedType
!DEF: /MainProgram1/ipdt/k TypeParam INTEGER(4)
diff --git a/flang/test/Semantics/modfile12.f90 b/flang/test/Semantics/modfile12.f90
index aab2e0f4b162c5..8bb6a2c413d8e6 100644
--- a/flang/test/Semantics/modfile12.f90
+++ b/flang/test/Semantics/modfile12.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_modfile.py %s %flang_fc1
module m
integer(8), parameter :: a = 1, b = 2_8
diff --git a/flang/test/Semantics/modfile26.f90 b/flang/test/Semantics/modfile26.f90
index 33b29f54f2e122..9c5d0015d91631 100644
--- a/flang/test/Semantics/modfile26.f90
+++ b/flang/test/Semantics/modfile26.f90
@@ -1,4 +1,4 @@
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_modfile.py %s %flang_fc1
! Intrinsics SELECTED_INT_KIND, SELECTED_REAL_KIND, PRECISION, RANGE,
! RADIX, DIGITS
diff --git a/flang/test/Semantics/realkinds-aarch64-01.f90 b/flang/test/Semantics/realkinds-aarch64-01.f90
index 327911c489a91d..2520c0b84c0e67 100644
--- a/flang/test/Semantics/realkinds-aarch64-01.f90
+++ b/flang/test/Semantics/realkinds-aarch64-01.f90
@@ -1,5 +1,5 @@
! REQUIRES: aarch64-registered-target
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_modfile.py %s %flang_fc1 -triple aarch64-unknown-linux-gnu
module m1
diff --git a/flang/test/Semantics/realkinds-systemz-01.f90 b/flang/test/Semantics/realkinds-systemz-01.f90
index 4026cbd3990bc8..20d7ee707349ca 100644
--- a/flang/test/Semantics/realkinds-systemz-01.f90
+++ b/flang/test/Semantics/realkinds-systemz-01.f90
@@ -1,5 +1,5 @@
! REQUIRES: systemz-registered-target
-! REQUIRES: flang-frontend-supports-f128
+! REQUIRES: flang-supports-f128-math
! RUN: %python %S/test_modfile.py %s %flang_fc1 -triple s390x-unknown-linux-gnu
module m1
diff --git a/flang/test/lit.cfg.py b/flang/test/lit.cfg.py
index 58b15b6f8c5448..27aae0bba8292c 100644
--- a/flang/test/lit.cfg.py
+++ b/flang/test/lit.cfg.py
@@ -287,9 +287,11 @@ def flang_frontend_supports_f128():
return flang_cmd.returncode == 0
-# Add a feature for tests that require frontend F128 support.
-if flang_frontend_supports_f128():
- config.available_features.add("flang-frontend-supports-f128")
+# Despite its name, this feature tests frontend F128 support, not math libraries.
+supports_f128 = flang_frontend_supports_f128()
+lit_config.note(f"frontend F128 support for {config.target_triple}: {supports_f128}")
+if supports_f128:
+ config.available_features.add("flang-supports-f128-math")
# Set OBJECT_MODE=64 as tools on AIX default to 32-bit.
if "system-aix" in config.available_features:
More information about the cfe-commits
mailing list