[compiler-rt] [compiler-rt] Disable tests for unavailable builtins (PR #158664)
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 08:47:35 PDT 2025
https://github.com/ahatanak created https://github.com/llvm/llvm-project/pull/158664
The builtins `__fixunstfdi` and `__multc3` may be removed by the preprocessor depending on configuration flags. When this happens, the corresponding tests fail at link time due to missing definitions.
Disable these tests when the builtins are not available.
rdar://159705803
rdar://159705705
>From 7e03b1dec651058f4bc3f135f372e0b01a6d15fa Mon Sep 17 00:00:00 2001
From: Akira Hatanaka <ahatanak at gmail.com>
Date: Mon, 15 Sep 2025 08:29:13 -0700
Subject: [PATCH] [compiler-rt] Disable tests for unavailable builtins
The builtins `__fixunstfdi` and `__multc3` may be removed by the
preprocessor depending on configuration flags. When this happens, the
corresponding tests fail at link time due to missing definitions.
Disable these tests when the builtins are not available.
rdar://159705803
rdar://159705705
---
compiler-rt/test/builtins/Unit/fixunstfdi_test.c | 4 ++--
compiler-rt/test/builtins/Unit/multc3_test.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
index 982f3a4629dbd..c78b187bf2fd1 100644
--- a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
+++ b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
@@ -4,7 +4,7 @@
#include <stdio.h>
-#if _ARCH_PPC || __aarch64__ || __arm64ec__
+#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_TF_MODE)
#include "int_lib.h"
@@ -35,7 +35,7 @@ char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
int main()
{
-#if _ARCH_PPC || __aarch64__ || __arm64ec__
+#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_TF_MODE)
if (test__fixunstfdi(0.0, 0))
return 1;
diff --git a/compiler-rt/test/builtins/Unit/multc3_test.c b/compiler-rt/test/builtins/Unit/multc3_test.c
index e9c99a72be35e..98373efc7259e 100644
--- a/compiler-rt/test/builtins/Unit/multc3_test.c
+++ b/compiler-rt/test/builtins/Unit/multc3_test.c
@@ -4,7 +4,7 @@
#include <stdio.h>
-#if _ARCH_PPC || __aarch64__ || __arm64ec__
+#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
#include "int_lib.h"
#include <math.h>
@@ -348,7 +348,7 @@ long double x[][2] =
int main()
{
-#if _ARCH_PPC || __aarch64__ || __arm64ec__
+#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
const unsigned N = sizeof(x) / sizeof(x[0]);
unsigned i, j;
for (i = 0; i < N; ++i)
More information about the llvm-commits
mailing list