summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-02-21 03:50:57 +0000
committerngie <ngie@FreeBSD.org>2017-02-21 03:50:57 +0000
commit1377d3fb9ca96a7c507590e2e9e83f9a8d126d15 (patch)
treecb77f0136d4d41b76bf277758ca8b6e33382c9ae
parente902f09805f6f217a23eeddcbeaf7199090b20bd (diff)
downloadFreeBSD-src-1377d3fb9ca96a7c507590e2e9e83f9a8d126d15.zip
FreeBSD-src-1377d3fb9ca96a7c507590e2e9e83f9a8d126d15.tar.gz
MFC r312213,r313713:
r312213: Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check of the clang version This works around breakage on ^/stable/10 when running installworld from a ^/stable/10 host where the test wouldn't be compiled on the first go-around and would be missing when make installworld is run. PR: 208703 r313713: Handle clang 4.x+ with the compile-time exception added in r312213 It also fails the assertions noted in bug 208703 PR: 208703 PR: 217084
-rw-r--r--lib/msun/tests/fmaxmin_test.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/msun/tests/fmaxmin_test.c b/lib/msun/tests/fmaxmin_test.c
index 7ddcc87..24056b0 100644
--- a/lib/msun/tests/fmaxmin_test.c
+++ b/lib/msun/tests/fmaxmin_test.c
@@ -86,6 +86,8 @@ testall_r(long double big, long double small)
return (ok);
}
+const char *comment = NULL;
+
/*
* Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl,
* in all rounding modes and with the arguments in different orders.
@@ -107,10 +109,18 @@ testall(int testnum, long double big, long double small)
break;
}
}
- printf("%sok %d - big = %.20Lg, small = %.20Lg\n",
- (i == 4) ? "" : "not ", testnum, big, small);
+ printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n",
+ (i == 4) ? "" : "not ", testnum, big, small,
+ comment == NULL ? "" : comment);
}
+/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */
+#if defined(__clang__) && \
+ ((__clang_major__ > 3)) || \
+ ((__clang_major__ == 3 && __clang_minor__ >= 8))
+#define affected_by_bug_208703
+#endif
+
int
main(int argc, char *argv[])
{
@@ -122,15 +132,23 @@ main(int argc, char *argv[])
testall(3, nextafterf(42.0, INFINITY), 42.0);
testall(4, -5.0, -5.0);
testall(5, -3.0, -4.0);
+#ifdef affected_by_bug_208703
+ comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)";
+#endif
testall(6, 1.0, NAN);
testall(7, INFINITY, NAN);
+ comment = NULL;
testall(8, INFINITY, 1.0);
testall(9, -3.0, -INFINITY);
testall(10, 3.0, -INFINITY);
+#ifdef affected_by_bug_208703
+ comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)";
+#endif
testall(11, NAN, NAN);
/* This test isn't strictly required to work by C99. */
testall(12, 0.0, -0.0);
+ comment = NULL;
return (0);
}
OpenPOWER on IntegriCloud