From 78a876ad601673d07fe4600d7ebfcf46587d819d Mon Sep 17 00:00:00 2001 From: Joe Ramsay Date: Wed, 9 Nov 2022 14:49:23 +0000 Subject: Make fenv checking dependent on WANT_ERRNO We want these tests to pass regardless of whether the user has enabled or disabled WANT_ERRNO - this is now supported by a WANT_ERRNO config option, which will be added to config.mk.dist in a follow-on. --- pl/math/Dir.mk | 2 +- pl/math/test/runulp.sh | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'pl') diff --git a/pl/math/Dir.mk b/pl/math/Dir.mk index 7909ea0..bb81052 100644 --- a/pl/math/Dir.mk +++ b/pl/math/Dir.mk @@ -128,7 +128,7 @@ check-pl/math-rtest: $(math-host-tools) $(math-tools) cat $(math-rtests) | build/pl/bin/rtest | $(EMULATOR) build/pl/bin/mathtest $(math-testflags) check-pl/math-ulp: $(math-tools) - WANT_SVE_MATH=$(WANT_SVE_MATH) ULPFLAGS="$(math-ulpflags)" build/pl/bin/runulp.sh $(EMULATOR) + WANT_ERRNO=$(WANT_ERRNO) WANT_SVE_MATH=$(WANT_SVE_MATH) ULPFLAGS="$(math-ulpflags)" build/pl/bin/runulp.sh $(EMULATOR) check-pl/math: check-pl/math-test check-pl/math-rtest check-pl/math-ulp diff --git a/pl/math/test/runulp.sh b/pl/math/test/runulp.sh index 53043d3..1690d5f 100755 --- a/pl/math/test/runulp.sh +++ b/pl/math/test/runulp.sh @@ -548,15 +548,22 @@ do do [ -n "$X" ] || continue # fenv checking is enabled by default, but we almost - # always want to disable it for vector routines, so a - # hack is needed. Pass "fenv" as fourth argument to - # prevent -f being added to the run line. + # always want to disable it for vector routines. There + # are, however, a small number of vector routines in + # pl/math which are supposed to set fenv correctly + # when WANT_ERRNO is enabled. A hack is needed to + # ensure fenv checking is enabled for routines where + # this is the case. Pass "fenv" as fourth argument to + # prevent -f being added to the run line when + # WANT_ERRNO is enabled. f="-f" - if [ "$D" = "fenv" ]; then - f="" - elif [ ! -z "$D" ]; then - echo "Unrecognised 4th argument: $D" - exit 1 + if [ $WANT_ERRNO -eq 1 ]; then + if [ "$D" = "fenv" ]; then + f="" + elif [ ! -z "$D" ]; then + echo "Unrecognised 4th argument: $D" + exit 1 + fi fi case "$X" in \#*) continue ;; esac t $f $F $X -- cgit v1.2.3