From 48976950cdc47a3e8979f7eae6379473d8438755 Mon Sep 17 00:00:00 2001 From: Elliot Saba Date: Tue, 26 Apr 2016 15:26:46 -0700 Subject: [PATCH] Remove floating-point exception checks when compiling with `clang` --- test/Makefile | 5 +++++ test/libm-test.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/test/Makefile b/test/Makefile index d2dba30..844766a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -11,6 +11,11 @@ all: test-double test-float # test-double-system test-float-system bench: bench-syslibm bench-openlibm +ifeq ($(USECLANG),1) +CPPFLAGS += -DUSECLANG=1 +endif + + test-double: test-double.c libm-test.c libm-test-ulps.h $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@ diff --git a/test/libm-test.c b/test/libm-test.c index a32b33f..cd4af2d 100644 --- a/test/libm-test.c +++ b/test/libm-test.c @@ -408,6 +408,9 @@ test_single_exception (const char *test_name, int fe_flag, const char *flag_name) { +/* Don't perform these checks if we're compiling with clang, because clang + doesn't bother to set floating-point exceptions properly */ +#ifndef USECLANG #ifndef TEST_INLINE int ok = 1; if (exception & exc_flag) @@ -445,6 +448,7 @@ test_single_exception (const char *test_name, ++noErrors; #endif +#endif // USECLANG }