Skip to content

Commit 7e03b1d

Browse files
committed
[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
1 parent 1aa7159 commit 7e03b1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler-rt/test/builtins/Unit/fixunstfdi_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <stdio.h>
66

7-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
7+
#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_TF_MODE)
88

99
#include "int_lib.h"
1010

@@ -35,7 +35,7 @@ char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
3535

3636
int main()
3737
{
38-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
38+
#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_TF_MODE)
3939
if (test__fixunstfdi(0.0, 0))
4040
return 1;
4141

compiler-rt/test/builtins/Unit/multc3_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <stdio.h>
66

7-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
7+
#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
88

99
#include "int_lib.h"
1010
#include <math.h>
@@ -348,7 +348,7 @@ long double x[][2] =
348348

349349
int main()
350350
{
351-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
351+
#if (_ARCH_PPC || __aarch64__ || __arm64ec__) && defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
352352
const unsigned N = sizeof(x) / sizeof(x[0]);
353353
unsigned i, j;
354354
for (i = 0; i < N; ++i)

0 commit comments

Comments
 (0)