[compiler-rt] 55920d9 - [compiler-rt][builtins][RISCV] Set COMPILER_RT_HAS_FLOAT16 for RISC-V compiler-rt tests, fixes test__extendhfsf2

Luís Marques via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 04:24:48 PDT 2022


Author: Luís Marques
Date: 2022-07-29T13:24:29+02:00
New Revision: 55920d92827c7a6dbb5c7d03f37686a46d7f817f

URL: https://github.com/llvm/llvm-project/commit/55920d92827c7a6dbb5c7d03f37686a46d7f817f
DIFF: https://github.com/llvm/llvm-project/commit/55920d92827c7a6dbb5c7d03f37686a46d7f817f.diff

LOG: [compiler-rt][builtins][RISCV] Set COMPILER_RT_HAS_FLOAT16 for RISC-V compiler-rt tests, fixes test__extendhfsf2

Since D92241, compiler-rt/cmake/builtin-config-ix.cmake automatically tests
the host compiler for support of _Float16 and conditionally defines
COMPILER_RT_HAS_FLOAT16. That defines the macro while the compiler-rt
builtins are being built. To also define it during the compiler-rt test
runs requires whitelisting the architecture in
compiler-rt/test/builtins/CMakeLists.txt, as done in this patch. That seems
brittle. Ideally, we'd move to a solution where the target compiler was
automatically tested as well, but I'm not sure how feasible that is with the
current CMake setup.

For now, this patch whitelists RISC-V, fixing errors in test__extendhfsf2.
Alternate solutions that fix the root issue are welcome, though.

Differential Revision: https://reviews.llvm.org/D129432

Added: 
    

Modified: 
    compiler-rt/test/builtins/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/builtins/CMakeLists.txt b/compiler-rt/test/builtins/CMakeLists.txt
index 1579e223e875d..df6893002afd0 100644
--- a/compiler-rt/test/builtins/CMakeLists.txt
+++ b/compiler-rt/test/builtins/CMakeLists.txt
@@ -46,7 +46,7 @@ foreach(arch ${BUILTIN_TEST_ARCH})
 
   if(APPLE)
     # TODO: Support the new ABI on Apple platforms.
-    if (${arch} MATCHES "arm|aarch64|arm64" AND COMPILER_RT_HAS_FLOAT16)
+    if (${arch} MATCHES "arm|aarch64|arm64|riscv32|riscv64" AND COMPILER_RT_HAS_FLOAT16)
       list(APPEND BUILTINS_TEST_TARGET_CFLAGS -DCOMPILER_RT_HAS_FLOAT16)
       string(REPLACE ";" " " BUILTINS_TEST_TARGET_CFLAGS "${BUILTINS_TEST_TARGET_CFLAGS}")
     endif()


        


More information about the llvm-commits mailing list