Skip to content

Commit 4897695

Browse files
committed
Remove floating-point exception checks when compiling with clang
1 parent 232ba9d commit 4897695

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

test/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ all: test-double test-float # test-double-system test-float-system
1111

1212
bench: bench-syslibm bench-openlibm
1313

14+
ifeq ($(USECLANG),1)
15+
CPPFLAGS += -DUSECLANG=1
16+
endif
17+
18+
1419
test-double: test-double.c libm-test.c libm-test-ulps.h
1520
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
1621

test/libm-test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ test_single_exception (const char *test_name,
408408
int fe_flag,
409409
const char *flag_name)
410410
{
411+
/* Don't perform these checks if we're compiling with clang, because clang
412+
doesn't bother to set floating-point exceptions properly */
413+
#ifndef USECLANG
411414
#ifndef TEST_INLINE
412415
int ok = 1;
413416
if (exception & exc_flag)
@@ -445,6 +448,7 @@ test_single_exception (const char *test_name,
445448
++noErrors;
446449

447450
#endif
451+
#endif // USECLANG
448452
}
449453

450454

0 commit comments

Comments
 (0)