Skip to content
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

[builtins][NFC] Avoid using CRT_LDBL_128BIT in tests #66832

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler-rt/test/builtins/Unit/compiler_rt_fmaxl_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <stdio.h>
#include "fp_lib.h"

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)

int test__compiler_rt_fmaxl(fp_t x, fp_t y) {
fp_t crt_value = __compiler_rt_fmaxl(x, y);
Expand Down Expand Up @@ -43,7 +43,7 @@ fp_t cases[] = {
#endif

int main() {
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
const unsigned N = sizeof(cases) / sizeof(cases[0]);
unsigned i, j;
for (i = 0; i < N; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/builtins/Unit/compiler_rt_logbl_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "fp_lib.h"
#include "int_lib.h"

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)

int test__compiler_rt_logbl(fp_t x) {
#if defined(__ve__)
Expand Down Expand Up @@ -42,7 +42,7 @@ double cases[] = {
#endif

int main() {
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
const unsigned N = sizeof(cases) / sizeof(cases[0]);
unsigned i;
for (i = 0; i < N; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/builtins/Unit/compiler_rt_scalbnl_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdio.h>
#include "fp_lib.h"

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)

int test__compiler_rt_scalbnl(const char *mode, fp_t x, int y) {
#if defined(__ve__)
Expand Down Expand Up @@ -67,7 +67,7 @@ int iterate_cases(const char *mode) {
#endif

int main() {
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
if (iterate_cases("default")) return 1;

// Skip rounding mode tests (fesetround) because compiler-rt's quad-precision
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/builtins/Unit/floattitf_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <float.h>
#include <stdio.h>

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
Copy link
Member

@arichardson arichardson Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one actually fails without an IEEE float128. Right now that doesn't matter but it will start failing once CRT_HAS_TF_MODE gets set with non-IEEE TF floats (powerpc64).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct guard added in #68132.


/* Returns: convert a ti_int to a fp_t, rounding toward even. */

Expand Down Expand Up @@ -39,7 +39,7 @@ char assumption_3[sizeof(fp_t) * CHAR_BIT == 128] = {0};
#endif

int main() {
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
if (test__floattitf(0, 0.0))
return 1;

Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/builtins/Unit/floatuntitf_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <float.h>
#include <stdio.h>

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)

/* Returns: convert a tu_int to a fp_t, rounding toward even. */

Expand Down Expand Up @@ -39,7 +39,7 @@ char assumption_3[sizeof(fp_t) * CHAR_BIT == 128] = {0};
#endif

int main() {
#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
#if defined(CRT_HAS_TF_MODE)
if (test__floatuntitf(0, 0.0))
return 1;

Expand Down