Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2017 09:05:27 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312213 - head/lib/msun/tests
Message-ID:  <201701150905.v0F95R5W061486@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Jan 15 09:05:26 2017
New Revision: 312213
URL: https://svnweb.freebsd.org/changeset/base/312213

Log:
  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.
  
  MFC after:	1 week
  PR:		208703
  Reported by:	emaste
  Sponsored by:	Dell EMC Isilon

Modified:
  head/lib/msun/tests/Makefile
  head/lib/msun/tests/fmaxmin_test.c

Modified: head/lib/msun/tests/Makefile
==============================================================================
--- head/lib/msun/tests/Makefile	Sun Jan 15 08:05:00 2017	(r312212)
+++ head/lib/msun/tests/Makefile	Sun Jan 15 09:05:26 2017	(r312213)
@@ -55,10 +55,7 @@ TAP_TESTS_C+=	ctrig_test
 TAP_TESTS_C+=	exponential_test
 TAP_TESTS_C+=	fenv_test
 TAP_TESTS_C+=	fma_test
-# clang 3.8.0 fails always fails this test. See: bug 208703
-.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30800)
 TAP_TESTS_C+=	fmaxmin_test
-.endif
 TAP_TESTS_C+=	ilogb2_test
 TAP_TESTS_C+=	invtrig_test
 TAP_TESTS_C+=	invctrig_test

Modified: head/lib/msun/tests/fmaxmin_test.c
==============================================================================
--- head/lib/msun/tests/fmaxmin_test.c	Sun Jan 15 08:05:00 2017	(r312212)
+++ head/lib/msun/tests/fmaxmin_test.c	Sun Jan 15 09:05:26 2017	(r312213)
@@ -86,6 +86,8 @@ testall_r(long double big, long double s
 	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,17 @@ testall(int testnum, long double big, lo
 			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_minor__ >= 8 && __clang_patchlevel__ >= 0)
+#define	affected_by_bug_208703
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -122,15 +131,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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701150905.v0F95R5W061486>