Module Name: src Committed By: martin Date: Tue Nov 18 08:58:08 UTC 2014
Modified Files: src/tests/lib/libc/gen: t_fpsetmask.c Log Message: Skip the tests on ARM if the NEON fpu does not support exceptions (Cortex). To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/gen/t_fpsetmask.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/gen/t_fpsetmask.c diff -u src/tests/lib/libc/gen/t_fpsetmask.c:1.14 src/tests/lib/libc/gen/t_fpsetmask.c:1.15 --- src/tests/lib/libc/gen/t_fpsetmask.c:1.14 Tue Nov 4 00:20:19 2014 +++ src/tests/lib/libc/gen/t_fpsetmask.c Tue Nov 18 08:58:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: t_fpsetmask.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_fpsetmask.c,v 1.15 2014/11/18 08:58:08 martin Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -58,8 +58,20 @@ ATF_TC_BODY(no_test, tc) #include <ieeefp.h> -const char *skip_mesg; -const char *skip_arch; +#if __arm__ && !__SOFTFP__ + /* + * Some NEON fpus do not implement IEEE exception handling, + * skip these tests if running on them and compiled for + * hard float. + */ +#define FPU_PREREQ() \ + if (0 == fpsetmask(fpsetmask(FP_X_INV))) \ + atf_tc_skip("FPU does not implement exception handling"); +#endif + +#ifndef FPU_PREREQ +#define FPU_PREREQ() /* nothing */ +#endif void sigfpe(int, siginfo_t *, void *); @@ -296,6 +308,9 @@ sigfpe(int s, siginfo_t *si, void *c) \ ATF_TC_BODY(m##_##t, tc) \ { \ + \ + FPU_PREREQ(); \ + \ if (strcmp(MACHINE, "macppc") == 0) \ atf_tc_expect_fail("PR port-macppc/46319"); \ \ @@ -323,6 +338,8 @@ ATF_TC_BODY(fpsetmask_basic, tc) size_t i; fp_except_t msk, lst[] = { FP_X_INV, FP_X_DZ, FP_X_OFL, FP_X_UFL }; + FPU_PREREQ(); + msk = fpgetmask(); for (i = 0; i < __arraycount(lst); i++) { fpsetmask(msk | lst[i]);