mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Don't use glibc <tgmath.h> when testing with Clang
Clang has its own <tgmath.h> and doesn't use <tgmath.h> from glibc. Pass "-I." to compiler only if $($(<F)-no-include-dot) are undefined. Define it to yes for tgmath tests when testing with Clang. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -1031,7 +1031,8 @@ endif
|
|||||||
# current directory.
|
# current directory.
|
||||||
+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
|
+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \
|
||||||
$(+sysdep-includes) $(includes) \
|
$(+sysdep-includes) $(includes) \
|
||||||
$(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes)
|
$(patsubst %/,-I%,$(..)) $(libio-include) \
|
||||||
|
$(if $($(<F)-no-include-dot),,-I.) $(sysincludes)
|
||||||
|
|
||||||
# Since libio has several internal header files, we use a -I instead
|
# Since libio has several internal header files, we use a -I instead
|
||||||
# of many little headers in the include directory.
|
# of many little headers in the include directory.
|
||||||
|
@@ -1 +1,7 @@
|
|||||||
#include <math/tgmath.h>
|
/* NB: Clang has its own <tgmath.h> and doesn't use <tgmath.h> from
|
||||||
|
glibc. */
|
||||||
|
#if defined _ISOMAC && defined __clang__
|
||||||
|
# include_next <tgmath.h>
|
||||||
|
#else
|
||||||
|
# include <math/tgmath.h>
|
||||||
|
#endif
|
||||||
|
@@ -510,7 +510,6 @@ tests = \
|
|||||||
$(tests-static) \
|
$(tests-static) \
|
||||||
bug-nextafter \
|
bug-nextafter \
|
||||||
bug-nexttoward \
|
bug-nexttoward \
|
||||||
bug-tgmath1 \
|
|
||||||
test-ceil-except-2 \
|
test-ceil-except-2 \
|
||||||
test-femode \
|
test-femode \
|
||||||
test-femode-traps \
|
test-femode-traps \
|
||||||
@@ -548,15 +547,18 @@ tests = \
|
|||||||
test-signgam-ullong \
|
test-signgam-ullong \
|
||||||
test-signgam-ullong-init \
|
test-signgam-ullong-init \
|
||||||
test-snan \
|
test-snan \
|
||||||
test-tgmath \
|
|
||||||
test-tgmath-int \
|
|
||||||
test-tgmath-ret \
|
|
||||||
test-tgmath2 \
|
|
||||||
test-trunc-except-2 \
|
test-trunc-except-2 \
|
||||||
tst-CMPLX \
|
tst-CMPLX \
|
||||||
tst-CMPLX2 \
|
tst-CMPLX2 \
|
||||||
tst-definitions \
|
tst-definitions \
|
||||||
# tests
|
# tests
|
||||||
|
tests-tgmath = \
|
||||||
|
bug-tgmath1 \
|
||||||
|
test-tgmath \
|
||||||
|
test-tgmath-int \
|
||||||
|
test-tgmath-ret \
|
||||||
|
test-tgmath2 \
|
||||||
|
# tests-tgmath
|
||||||
ifneq ($(config-cflags-signaling-nans),)
|
ifneq ($(config-cflags-signaling-nans),)
|
||||||
tests += \
|
tests += \
|
||||||
test-fe-snans-always-signal \
|
test-fe-snans-always-signal \
|
||||||
@@ -1026,7 +1028,9 @@ tgmath3-macros = \
|
|||||||
ufromfpx \
|
ufromfpx \
|
||||||
# tgmath3-macros
|
# tgmath3-macros
|
||||||
tgmath3-macro-tests = $(addprefix test-tgmath3-,$(tgmath3-macros))
|
tgmath3-macro-tests = $(addprefix test-tgmath3-,$(tgmath3-macros))
|
||||||
tests += $(tgmath3-macro-tests)
|
tests-tgmath += $(tgmath3-macro-tests)
|
||||||
|
tests += $(tests-tgmath)
|
||||||
|
|
||||||
generated += $(addsuffix .c,$(tgmath3-macro-tests))
|
generated += $(addsuffix .c,$(tgmath3-macro-tests))
|
||||||
|
|
||||||
$(tgmath3-macro-tests:%=$(objpfx)%.o): CFLAGS += -fno-builtin
|
$(tgmath3-macro-tests:%=$(objpfx)%.o): CFLAGS += -fno-builtin
|
||||||
@@ -1043,6 +1047,14 @@ $(objpfx)test-tgmath3-macro-list.out: gen-tgmath-tests.py
|
|||||||
$(PYTHON) $< check-list $(tgmath3-macros) > $@; \
|
$(PYTHON) $< check-list $(tgmath3-macros) > $@; \
|
||||||
$(evaluate-test)
|
$(evaluate-test)
|
||||||
|
|
||||||
|
ifeq ($(have-test-clang),yes)
|
||||||
|
# NB: Clang has its own <tgmath.h> and doesn't use <tgmath.h> from glibc.
|
||||||
|
define no-include
|
||||||
|
$(1).c-no-include-dot = yes
|
||||||
|
endef
|
||||||
|
$(foreach m,$(tests-tgmath),$(eval $(call no-include,$(m))))
|
||||||
|
endif
|
||||||
|
|
||||||
libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH
|
libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH
|
||||||
libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \
|
libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \
|
||||||
-ffloat-store -D_OPENMP=201307 -Wno-unknown-pragmas
|
-ffloat-store -D_OPENMP=201307 -Wno-unknown-pragmas
|
||||||
|
Reference in New Issue
Block a user