-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[compiler-rt] Disable tests for unavailable builtins #161275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ahatanak
merged 2 commits into
llvm:main
from
ahatanak:disable-unavailable-builtin-tests2
Sep 29, 2025
Merged
[compiler-rt] Disable tests for unavailable builtins #161275
ahatanak
merged 2 commits into
llvm:main
from
ahatanak:disable-unavailable-builtin-tests2
Sep 29, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This fixes the ifdefs added in e9e166e; we need to include int_lib.h first before we can expect these defines to be set. Also remove the XFAILs for aarch64 windows. As this test now became a no-op on platforms that lack CRT_HAS_128BIT or CRT_HAS_F128 (aarch64 windows lacks the latter), it no longer fails.
jroelofs
approved these changes
Sep 29, 2025
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions c -- compiler-rt/test/builtins/Unit/fixunstfdi_test.c compiler-rt/test/builtins/Unit/multc3_test.c
View the diff from clang-format here.diff --git a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
index 526ba5ca8..27b69d17c 100644
--- a/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
+++ b/compiler-rt/test/builtins/Unit/fixunstfdi_test.c
@@ -1,13 +1,13 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_fixunstfdi
-#include <stdio.h>
#include "int_lib.h"
+#include <stdio.h>
#if defined(CRT_HAS_TF_MODE)
-#define QUAD_PRECISION
-#include "fp_lib.h"
+# define QUAD_PRECISION
+# include "fp_lib.h"
// Returns: convert a to a unsigned long long, rounding toward zero.
// Negative values all become zero.
@@ -37,77 +37,77 @@ char assumption_3[sizeof(fp_t)*CHAR_BIT == 128] = {0};
int main()
{
#if defined(CRT_HAS_TF_MODE)
- if (test__fixunstfdi(0.0, 0))
- return 1;
-
- if (test__fixunstfdi(0.5, 0))
- return 1;
- if (test__fixunstfdi(0.99, 0))
- return 1;
- if (test__fixunstfdi(1.0, 1))
- return 1;
- if (test__fixunstfdi(1.5, 1))
- return 1;
- if (test__fixunstfdi(1.99, 1))
- return 1;
- if (test__fixunstfdi(2.0, 2))
- return 1;
- if (test__fixunstfdi(2.01, 2))
- return 1;
- if (test__fixunstfdi(-0.5, 0))
- return 1;
- if (test__fixunstfdi(-0.99, 0))
- return 1;
- if (test__fixunstfdi(-1.0, 0))
- return 1;
- if (test__fixunstfdi(-1.5, 0))
- return 1;
- if (test__fixunstfdi(-1.99, 0))
- return 1;
- if (test__fixunstfdi(-2.0, 0))
- return 1;
- if (test__fixunstfdi(-2.01, 0))
- return 1;
-
- if (test__fixunstfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL))
- return 1;
- if (test__fixunstfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL))
- return 1;
-
- if (test__fixunstfdi(-0x1.FFFFFEp+62, 0))
- return 1;
- if (test__fixunstfdi(-0x1.FFFFFCp+62, 0))
- return 1;
-
- if (test__fixunstfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL))
- return 1;
- if (test__fixunstfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL))
- return 1;
-
- if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0))
- return 1;
- if (test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0))
- return 1;
-
- if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL))
- return 1;
- if (test__fixunstfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL))
- return 1;
- if (test__fixunstfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL))
- return 1;
- if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL))
- return 1;
- if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL))
- return 1;
- if (test__fixunstfdi(0x1.p+64L, 0xFFFFFFFFFFFFFFFFLL))
- return 1;
-
- if (test__fixunstfdi(-0x1.0000000000000000p+63L, 0))
- return 1;
- if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0))
- return 1;
- if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0))
- return 1;
+ if (test__fixunstfdi(0.0, 0))
+ return 1;
+
+ if (test__fixunstfdi(0.5, 0))
+ return 1;
+ if (test__fixunstfdi(0.99, 0))
+ return 1;
+ if (test__fixunstfdi(1.0, 1))
+ return 1;
+ if (test__fixunstfdi(1.5, 1))
+ return 1;
+ if (test__fixunstfdi(1.99, 1))
+ return 1;
+ if (test__fixunstfdi(2.0, 2))
+ return 1;
+ if (test__fixunstfdi(2.01, 2))
+ return 1;
+ if (test__fixunstfdi(-0.5, 0))
+ return 1;
+ if (test__fixunstfdi(-0.99, 0))
+ return 1;
+ if (test__fixunstfdi(-1.0, 0))
+ return 1;
+ if (test__fixunstfdi(-1.5, 0))
+ return 1;
+ if (test__fixunstfdi(-1.99, 0))
+ return 1;
+ if (test__fixunstfdi(-2.0, 0))
+ return 1;
+ if (test__fixunstfdi(-2.01, 0))
+ return 1;
+
+ if (test__fixunstfdi(0x1.FFFFFEp+62, 0x7FFFFF8000000000LL))
+ return 1;
+ if (test__fixunstfdi(0x1.FFFFFCp+62, 0x7FFFFF0000000000LL))
+ return 1;
+
+ if (test__fixunstfdi(-0x1.FFFFFEp+62, 0))
+ return 1;
+ if (test__fixunstfdi(-0x1.FFFFFCp+62, 0))
+ return 1;
+
+ if (test__fixunstfdi(0x1.FFFFFFFFFFFFFp+62, 0x7FFFFFFFFFFFFC00LL))
+ return 1;
+ if (test__fixunstfdi(0x1.FFFFFFFFFFFFEp+62, 0x7FFFFFFFFFFFF800LL))
+ return 1;
+
+ if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0))
+ return 1;
+ if (test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0))
+ return 1;
+
+ if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63L, 0xFFFFFFFFFFFFFFFFLL))
+ return 1;
+ if (test__fixunstfdi(0x1.0000000000000002p+63L, 0x8000000000000001LL))
+ return 1;
+ if (test__fixunstfdi(0x1.0000000000000000p+63L, 0x8000000000000000LL))
+ return 1;
+ if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62L, 0x7FFFFFFFFFFFFFFFLL))
+ return 1;
+ if (test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62L, 0x7FFFFFFFFFFFFFFELL))
+ return 1;
+ if (test__fixunstfdi(0x1.p+64L, 0xFFFFFFFFFFFFFFFFLL))
+ return 1;
+
+ if (test__fixunstfdi(-0x1.0000000000000000p+63L, 0))
+ return 1;
+ if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62L, 0))
+ return 1;
+ if (test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62L, 0))
+ return 1;
#else
printf("skipped\n");
diff --git a/compiler-rt/test/builtins/Unit/multc3_test.c b/compiler-rt/test/builtins/Unit/multc3_test.c
index 18561cc34..f5d12431f 100644
--- a/compiler-rt/test/builtins/Unit/multc3_test.c
+++ b/compiler-rt/test/builtins/Unit/multc3_test.c
@@ -1,16 +1,16 @@
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_multc3
-#include <stdio.h>
#include "int_lib.h"
+#include <stdio.h>
#if defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
-#define QUAD_PRECISION
-#include "fp_lib.h"
+# define QUAD_PRECISION
+# include "fp_lib.h"
-#include <math.h>
-#include <complex.h>
+# include <math.h>
+# include <complex.h>
// Returns: the product of a + ib and c + id
@@ -351,16 +351,14 @@ fp_t x[][2] =
int main()
{
#if 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)
- {
- for (j = 0; j < N; ++j)
- {
- if (test__multc3(x[i][0], x[i][1], x[j][0], x[j][1]))
- return 1;
- }
+ const unsigned N = sizeof(x) / sizeof(x[0]);
+ unsigned i, j;
+ for (i = 0; i < N; ++i) {
+ for (j = 0; j < N; ++j) {
+ if (test__multc3(x[i][0], x[i][1], x[j][0], x[j][1]))
+ return 1;
}
+ }
#else
printf("skipped\n");
#endif
|
mahesh-attarde
pushed a commit
to mahesh-attarde/llvm-project
that referenced
this pull request
Oct 3, 2025
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. Also remove the XFAILs for aarch64 windows. As this test now became a no-op on platforms that lack CRT_HAS_128BIT or CRT_HAS_F128 (aarch64 windows lacks the latter), it no longer fails. This reapplies e9e166e and 6567070 after fixing declarations of the builtins in the tests in b542509. rdar://159705803 rdar://159705705 --------- Co-authored-by: Martin Storsjö <martin@martin.st>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The builtins
__fixunstfdi
and__multc3
may be removed by thepreprocessor 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.
Also remove the XFAILs for aarch64 windows. As this test now became a
no-op on platforms that lack CRT_HAS_128BIT or CRT_HAS_F128 (aarch64
windows lacks the latter), it no longer fails.
This reapplies e9e166e and 6567070 after fixing declarations of
the builtins in the tests in b542509.
rdar://159705803
rdar://159705705
Co-authored-by: Martin Storsjö martin@martin.st