Skip to content

Commit 12a5854

Browse files
ahatanakmstorsjo
andauthored
[compiler-rt] Disable tests for unavailable builtins (#161275)
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ö <[email protected]>
1 parent 07f8f08 commit 12a5854

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
// XFAIL: target=aarch64-{{.*}}-windows-{{.*}}
21
// RUN: %clang_builtins %s %librt -o %t && %run %t
32
// REQUIRES: librt_has_fixunstfdi
43

54
#include <stdio.h>
5+
#include "int_lib.h"
66

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

99
#define QUAD_PRECISION
1010
#include "fp_lib.h"
1111

12-
#include "int_lib.h"
13-
1412
// Returns: convert a to a unsigned long long, rounding toward zero.
1513
// Negative values all become zero.
1614

@@ -38,7 +36,7 @@ char assumption_3[sizeof(fp_t)*CHAR_BIT == 128] = {0};
3836

3937
int main()
4038
{
41-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
39+
#if defined(CRT_HAS_TF_MODE)
4240
if (test__fixunstfdi(0.0, 0))
4341
return 1;
4442

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
// XFAIL: target=aarch64-{{.*}}-windows-{{.*}}
21
// RUN: %clang_builtins %s %librt -o %t && %run %t
32
// REQUIRES: librt_has_multc3
43

54
#include <stdio.h>
5+
#include "int_lib.h"
66

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

99
#define QUAD_PRECISION
1010
#include "fp_lib.h"
1111

12-
#include "int_lib.h"
1312
#include <math.h>
1413
#include <complex.h>
1514

@@ -351,7 +350,7 @@ fp_t x[][2] =
351350

352351
int main()
353352
{
354-
#if _ARCH_PPC || __aarch64__ || __arm64ec__
353+
#if defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
355354
const unsigned N = sizeof(x) / sizeof(x[0]);
356355
unsigned i, j;
357356
for (i = 0; i < N; ++i)

0 commit comments

Comments
 (0)