[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r22998 - in /fsf/trunk/libc: ChangeLog math/README.libm-test math/gen-libm-test.pl math/libm-test.inc
- To: commits@xxxxxxxxxx
- Subject: [Commits] r22998 - in /fsf/trunk/libc: ChangeLog math/README.libm-test math/gen-libm-test.pl math/libm-test.inc
- From: eglibc@xxxxxxxxxx
- Date: Sun, 05 May 2013 00:02:03 -0000
Author: eglibc
Date: Sun May 5 00:02:02 2013
New Revision: 22998
Log:
Import glibc-mainline for 2013-05-05
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/math/README.libm-test
fsf/trunk/libc/math/gen-libm-test.pl
fsf/trunk/libc/math/libm-test.inc
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun May 5 00:02:02 2013
@@ -1,3 +1,46 @@
+2013-05-04 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * math/libm-test.inc (noXFails): Remove variable.
+ (noXPasses): Likewise.
+ (BUILD_COMPLEX_INT): Remove macro.
+ (print_screen): Remove xfail argument.
+ (print_screen_max_error): Likewise.
+ (update_stats): Likewise.
+ (print_max_error): Likewise. Update calls to other affected
+ functions.
+ (print_complex_max_error): Likewise.
+ (test_single_exception): Update calls to print_screen.
+ (test_single_errno): Likewise.
+ (check_float_internal): Remove xfail argument. Update calls to
+ other affected functions.
+ (check_float): Likewise.
+ (check_complex): Likewise.
+ (check_int): Likewise.
+ (check_long): Likewise.
+ (check_bool): Likewise.
+ (check_longlong): Likewise.
+ (main): Don't print noXFails and noXPasses.
+ * math/gen-libm-test.pl (top level): Don't mention expected
+ failure handling in comment.
+ (new_test): Don't handle expected failures.
+ (parse_args): Don't mention expected failure handling in comment.
+ (generate_testfile): Don't handle expected failures.
+ (parse_ulps): Likewise.
+ (print_ulps_file): Likewise.
+ (get_failure): Remove function.
+ (output_test): Don't handle expected failures.
+ * make/README.libm-test: Don't mention expected failure handling.
+
+ * math/libm-test.inc (plus_zero): Make const. Add initializer.
+ (minus_zero): Likewise.
+ (plus_infty): Likewise.
+ (minus_infty): Likewise.
+ (qnan_value): Likewise.
+ (max_value): Likewise.
+ (min_value): Likewise.
+ (min_subnorm_value): Likewise.
+ (initialize): Do not initialize those variables dynamically.
+
2013-05-03 Roland McGrath <roland@xxxxxxxxxxxxx>
* io/open.c (__open_2): Moved to ...
Modified: fsf/trunk/libc/math/README.libm-test
==============================================================================
--- fsf/trunk/libc/math/README.libm-test (original)
+++ fsf/trunk/libc/math/README.libm-test Sun May 5 00:02:02 2013
@@ -78,12 +78,7 @@
idouble: 6.0000
The keywords are float, ifloat, double, idouble, ldouble and ildouble
-(the prefix i stands for inline). You can also specify known
-failures, e.g.:
-
-Test "cos (pi/2) == 0":
-float: 1
-float: fail
+(the prefix i stands for inline).
Adding tests to libm-test.inc
=============================
Modified: fsf/trunk/libc/math/gen-libm-test.pl
==============================================================================
--- fsf/trunk/libc/math/gen-libm-test.pl (original)
+++ fsf/trunk/libc/math/gen-libm-test.pl Sun May 5 00:02:02 2013
@@ -25,7 +25,6 @@
# is a maximal error of a function or a single test.
# $results{$test}{"type"} is the result type, e.g. normal or complex.
# $results{$test}{"has_ulps"} is set if deltas exist.
-# $results{$test}{"has_fails"} is set if exptected failures exist.
# In the following description $type and $float are:
# - $type is either "normal", "real" (for the real part of a complex number)
# or "imag" (for the imaginary part # of a complex number).
@@ -33,8 +32,6 @@
# It represents the underlying floating point type (float, double or long
# double) and if inline functions (the leading i stands for inline)
# are used.
-# $results{$test}{$type}{"fail"}{$float} is defined and has a 1 if
-# the test is expected to fail
# $results{$test}{$type}{"ulp"}{$float} is defined and has a delta as value
@@ -164,21 +161,16 @@
}
# Add a new test to internal data structures and fill in the
-# ulps, failures and exception information for the C line.
+# ulps and exception information for the C line.
sub new_test {
my ($test, $exception) = @_;
my $rest;
- # Add ulp, xfail
+ # Add ulp.
if (exists $results{$test}{'has_ulps'}) {
$rest = ", DELTA$count";
} else {
$rest = ', 0';
- }
- if (exists $results{$test}{'has_fails'}) {
- $rest .= ", FAIL$count";
- } else {
- $rest .= ', 0';
}
if (defined $exception) {
$rest .= ", $exception";
@@ -369,7 +361,7 @@
++$current_arg;
}
}
- # Add ulp, xfail
+ # Add ulp.
$cline .= &new_test ($str, ($current_arg <= $#args) ? $args[$current_arg] : undef);
# special treatment for some functions
@@ -456,11 +448,6 @@
$line .= "DELTA$fct";
} else {
$line .= '0';
- }
- if (exists $results{$fct}{'has_fails'}) {
- $line .= ", FAIL$fct";
- } else {
- $line .= ', 0';
}
$line .= ");\n";
print OUTPUT $line;
@@ -522,10 +509,7 @@
if (/^i?(float|double|ldouble):/) {
($float, $eps) = split /\s*:\s*/,$_,2;
- if ($eps eq 'fail') {
- $results{$test}{$type}{'fail'}{$float} = 1;
- $results{$test}{'has_fails'} = 1;
- } elsif ($eps eq "0") {
+ if ($eps eq "0") {
# ignore
next;
} else {
@@ -591,9 +575,6 @@
&clean_up_number ($results{$test}{$type}{'ulp'}{$float}),
"\n";
}
- if (exists $results{$test}{$type}{'fail'}{$float}) {
- print NEWULP "$float: fail\n";
- }
}
}
}
@@ -617,9 +598,6 @@
&clean_up_number ($results{$fct}{$type}{'ulp'}{$float}),
"\n";
}
- if (exists $results{$fct}{$type}{'fail'}{$float}) {
- print NEWULP "$float: fail\n";
- }
}
print NEWULP "\n";
}
@@ -652,37 +630,13 @@
? $results{$test}{'normal'}{'ulp'}{$float} : "0");
}
-sub get_failure {
- my ($test, $type, $float) = @_;
- if ($type eq 'complex') {
- # return x,y
- my ($res);
- # Return 0 instead of BUILD_COMPLEX_INT (0,0)
- if (!exists $results{$test}{'real'}{'ulp'}{$float} &&
- !exists $results{$test}{'imag'}{'ulp'}{$float}) {
- return "0";
- }
- $res = 'BUILD_COMPLEX_INT (';
- $res .= (exists $results{$test}{'real'}{'fail'}{$float}
- ? $results{$test}{'real'}{'fail'}{$float} : "0");
- $res .= ', ';
- $res .= (exists $results{$test}{'imag'}{'fail'}{$float}
- ? $results{$test}{'imag'}{'fail'}{$float} : "0");
- $res .= ')';
- return $res;
- }
- return (exists $results{$test}{'normal'}{'fail'}{$float}
- ? $results{$test}{'normal'}{'fail'}{$float} : "0");
-
-}
-
# Output the defines for a single test
sub output_test {
my ($file, $test, $name) = @_;
my ($ldouble, $double, $float, $ildouble, $idouble, $ifloat);
my ($type);
- # Do we have ulps/failures?
+ # Do we have ulps?
if (!exists $results{$test}{'type'}) {
return;
}
@@ -697,16 +651,6 @@
$ifloat = &get_ulps ($test, $type, "ifloat");
print $file "#define DELTA$name CHOOSE($ldouble, $double, $float, $ildouble, $idouble, $ifloat)\t/* $test */\n";
}
-
- if (exists $results{$test}{'has_fails'}) {
- $ldouble = &get_failure ($test, "ldouble");
- $double = &get_failure ($test, "double");
- $float = &get_failure ($test, "float");
- $ildouble = &get_failure ($test, "ildouble");
- $idouble = &get_failure ($test, "idouble");
- $ifloat = &get_failure ($test, "ifloat");
- print $file "#define FAIL$name CHOOSE($ldouble, $double, $float $ildouble, $idouble, $ifloat)\t/* $test */\n";
- }
}
# Print include file
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sun May 5 00:02:02 2013
@@ -223,29 +223,37 @@
static int noTests; /* number of tests (without testing exceptions) */
static int noExcTests; /* number of tests for exception flags */
static int noErrnoTests;/* number of tests for errno values */
-static int noXFails; /* number of expected failures. */
-static int noXPasses; /* number of unexpected passes. */
static int verbose;
static int output_max_error; /* Should the maximal errors printed? */
static int output_points; /* Should the single function results printed? */
static int ignore_max_ulp; /* Should we ignore max_ulp? */
-static FLOAT minus_zero, plus_zero;
-static FLOAT plus_infty, minus_infty, qnan_value, max_value, min_value;
-static FLOAT min_subnorm_value;
+static const FLOAT plus_zero = CHOOSE (0.0L, 0.0, 0.0f,
+ 0.0L, 0.0, 0.0f);
+static const FLOAT minus_zero = CHOOSE (-0.0L, -0.0, -0.0f,
+ -0.0L, -0.0, -0.0f);
+static const FLOAT plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF,
+ HUGE_VALL, HUGE_VAL, HUGE_VALF);
+static const FLOAT minus_infty = CHOOSE (-HUGE_VALL, -HUGE_VAL, -HUGE_VALF,
+ -HUGE_VALL, -HUGE_VAL, -HUGE_VALF);
+static const FLOAT qnan_value = FUNC (__builtin_nan) ("");
+static const FLOAT max_value = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
+ LDBL_MAX, DBL_MAX, FLT_MAX);
+static const FLOAT min_value = CHOOSE (LDBL_MIN, DBL_MIN, FLT_MIN,
+ LDBL_MIN, DBL_MIN, FLT_MIN);
+static const FLOAT min_subnorm_value = CHOOSE (__LDBL_DENORM_MIN__,
+ __DBL_DENORM_MIN__,
+ __FLT_DENORM_MIN__,
+ __LDBL_DENORM_MIN__,
+ __DBL_DENORM_MIN__,
+ __FLT_DENORM_MIN__);
static FLOAT max_error, real_max_error, imag_max_error;
#define BUILD_COMPLEX(real, imag) \
({ __complex__ FLOAT __retval; \
- __real__ __retval = (real); \
- __imag__ __retval = (imag); \
- __retval; })
-
-#define BUILD_COMPLEX_INT(real, imag) \
- ({ __complex__ int __retval; \
__real__ __retval = (real); \
__imag__ __retval = (imag); \
__retval; })
@@ -288,11 +296,11 @@
/* Should the message print to screen? This depends on the verbose flag,
and the test status. */
static int
-print_screen (int ok, int xfail)
+print_screen (int ok)
{
if (output_points
&& (verbose > 1
- || (verbose == 1 && ok == xfail)))
+ || (verbose == 1 && ok == 0)))
return 1;
return 0;
}
@@ -301,25 +309,21 @@
/* Should the message print to screen? This depends on the verbose flag,
and the test status. */
static int
-print_screen_max_error (int ok, int xfail)
+print_screen_max_error (int ok)
{
if (output_max_error
&& (verbose > 1
- || ((verbose == 1) && (ok == xfail))))
+ || ((verbose == 1) && (ok == 0))))
return 1;
return 0;
}
/* Update statistic counters. */
static void
-update_stats (int ok, int xfail)
+update_stats (int ok)
{
++noTests;
- if (ok && xfail)
- ++noXPasses;
- else if (!ok && xfail)
- ++noXFails;
- else if (!ok && !xfail)
+ if (!ok)
++noErrors;
}
@@ -403,7 +407,7 @@
static void
-print_max_error (const char *func_name, FLOAT allowed, int xfail)
+print_max_error (const char *func_name, FLOAT allowed)
{
int ok = 0;
@@ -416,20 +420,19 @@
print_function_ulps (func_name, max_error);
- if (print_screen_max_error (ok, xfail))
+ if (print_screen_max_error (ok))
{
printf ("Maximal error of `%s'\n", func_name);
printf (" is : %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (max_error));
printf (" accepted: %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (allowed));
}
- update_stats (ok, xfail);
-}
-
-
-static void
-print_complex_max_error (const char *func_name, __complex__ FLOAT allowed,
- __complex__ int xfail)
+ update_stats (ok);
+}
+
+
+static void
+print_complex_max_error (const char *func_name, __complex__ FLOAT allowed)
{
int ok = 0;
@@ -445,7 +448,7 @@
print_complex_function_ulps (func_name, real_max_error, imag_max_error);
- if (print_screen_max_error (ok, xfail))
+ if (print_screen_max_error (ok))
{
printf ("Maximal error of real part of: %s\n", func_name);
printf (" is : %.0" PRINTF_NEXPR " ulp\n",
@@ -459,7 +462,7 @@
FUNC(ceil) (__imag__ allowed));
}
- update_stats (ok, xfail);
+ update_stats (ok);
}
@@ -477,13 +480,13 @@
{
if (fetestexcept (fe_flag))
{
- if (print_screen (1, 0))
+ if (print_screen (1))
printf ("Pass: %s: Exception \"%s\" set\n", test_name, flag_name);
}
else
{
ok = 0;
- if (print_screen (0, 0))
+ if (print_screen (0))
printf ("Failure: %s: Exception \"%s\" not set\n",
test_name, flag_name);
}
@@ -493,13 +496,13 @@
if (fetestexcept (fe_flag))
{
ok = 0;
- if (print_screen (0, 0))
+ if (print_screen (0))
printf ("Failure: %s: Exception \"%s\" set\n",
test_name, flag_name);
}
else
{
- if (print_screen (1, 0))
+ if (print_screen (1))
printf ("%s: Exception \"%s\" not set\n", test_name,
flag_name);
}
@@ -550,14 +553,14 @@
{
if (errno_value == expected_value)
{
- if (print_screen (1, 0))
+ if (print_screen (1))
printf ("Pass: %s: errno set to %d (%s)\n", test_name, errno_value,
expected_name);
}
else
{
++noErrors;
- if (print_screen (0, 0))
+ if (print_screen (0))
printf ("Failure: %s: errno set to %d, expected %d (%s)\n",
test_name, errno_value, expected_value, expected_name);
}
@@ -579,7 +582,7 @@
static void
check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
- FLOAT max_ulp, int xfail, int exceptions,
+ FLOAT max_ulp, int exceptions,
FLOAT *curr_max_error)
{
int ok = 0;
@@ -649,7 +652,7 @@
}
}
- if (print_screen (ok, xfail))
+ if (print_screen (ok))
{
if (!ok)
printf ("Failure: ");
@@ -667,7 +670,7 @@
printf (" max.ulp : % .4" PRINTF_NEXPR "\n", max_ulp);
}
}
- update_stats (ok, xfail);
+ update_stats (ok);
fpstack_test (test_name);
errno = 0;
@@ -676,9 +679,9 @@
static void
check_float (const char *test_name, FLOAT computed, FLOAT expected,
- FLOAT max_ulp, int xfail, int exceptions)
-{
- check_float_internal (test_name, computed, expected, max_ulp, xfail,
+ FLOAT max_ulp, int exceptions)
+{
+ check_float_internal (test_name, computed, expected, max_ulp,
exceptions, &max_error);
}
@@ -686,11 +689,10 @@
static void
check_complex (const char *test_name, __complex__ FLOAT computed,
__complex__ FLOAT expected,
- __complex__ FLOAT max_ulp, __complex__ int xfail,
+ __complex__ FLOAT max_ulp,
int exception)
{
FLOAT part_comp, part_exp, part_max_ulp;
- int part_xfail;
char *str;
if (asprintf (&str, "Real part of: %s", test_name) == -1)
@@ -699,9 +701,8 @@
part_comp = __real__ computed;
part_exp = __real__ expected;
part_max_ulp = __real__ max_ulp;
- part_xfail = __real__ xfail;
-
- check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
+
+ check_float_internal (str, part_comp, part_exp, part_max_ulp,
exception, &real_max_error);
free (str);
@@ -711,11 +712,10 @@
part_comp = __imag__ computed;
part_exp = __imag__ expected;
part_max_ulp = __imag__ max_ulp;
- part_xfail = __imag__ xfail;
/* Don't check again for exceptions or errno, just pass through the
zero/inf sign test. */
- check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
+ check_float_internal (str, part_comp, part_exp, part_max_ulp,
exception & IGNORE_ZERO_INF_SIGN,
&imag_max_error);
free (str);
@@ -725,7 +725,7 @@
/* Check that computed and expected values are equal (int values). */
static void
check_int (const char *test_name, int computed, int expected, int max_ulp,
- int xfail, int exceptions)
+ int exceptions)
{
int diff = computed - expected;
int ok = 0;
@@ -740,7 +740,7 @@
if (!ok)
print_ulps (test_name, diff);
- if (print_screen (ok, xfail))
+ if (print_screen (ok))
{
if (!ok)
printf ("Failure: ");
@@ -750,7 +750,7 @@
printf (" should be: %d\n", expected);
}
- update_stats (ok, xfail);
+ update_stats (ok);
fpstack_test (test_name);
errno = 0;
}
@@ -759,7 +759,7 @@
/* Check that computed and expected values are equal (long int values). */
static void
check_long (const char *test_name, long int computed, long int expected,
- long int max_ulp, int xfail, int exceptions)
+ long int max_ulp, int exceptions)
{
long int diff = computed - expected;
int ok = 0;
@@ -774,7 +774,7 @@
if (!ok)
print_ulps (test_name, diff);
- if (print_screen (ok, xfail))
+ if (print_screen (ok))
{
if (!ok)
printf ("Failure: ");
@@ -784,7 +784,7 @@
printf (" should be: %ld\n", expected);
}
- update_stats (ok, xfail);
+ update_stats (ok);
fpstack_test (test_name);
errno = 0;
}
@@ -793,7 +793,7 @@
/* Check that computed value is true/false. */
static void
check_bool (const char *test_name, int computed, int expected,
- long int max_ulp, int xfail, int exceptions)
+ long int max_ulp, int exceptions)
{
int ok = 0;
int errno_value = errno;
@@ -804,7 +804,7 @@
if ((computed == 0) == (expected == 0))
ok = 1;
- if (print_screen (ok, xfail))
+ if (print_screen (ok))
{
if (!ok)
printf ("Failure: ");
@@ -814,7 +814,7 @@
printf (" should be: %d\n", expected);
}
- update_stats (ok, xfail);
+ update_stats (ok);
fpstack_test (test_name);
errno = 0;
}
@@ -824,7 +824,7 @@
static void
check_longlong (const char *test_name, long long int computed,
long long int expected,
- long long int max_ulp, int xfail,
+ long long int max_ulp,
int exceptions)
{
long long int diff = computed - expected;
@@ -840,7 +840,7 @@
if (!ok)
print_ulps (test_name, diff);
- if (print_screen (ok, xfail))
+ if (print_screen (ok))
{
if (!ok)
printf ("Failure:");
@@ -850,7 +850,7 @@
printf (" should be: %lld\n", expected);
}
- update_stats (ok, xfail);
+ update_stats (ok);
fpstack_test (test_name);
errno = 0;
}
@@ -13814,33 +13814,6 @@
{
fpstack_test ("start *init*");
- plus_zero = 0.0;
- qnan_value = FUNC (__builtin_nan) ("");
- minus_zero = FUNC (copysign) (0.0, -1.0);
- plus_infty = CHOOSE (HUGE_VALL, HUGE_VAL, HUGE_VALF,
- HUGE_VALL, HUGE_VAL, HUGE_VALF);
- minus_infty = CHOOSE (-HUGE_VALL, -HUGE_VAL, -HUGE_VALF,
- -HUGE_VALL, -HUGE_VAL, -HUGE_VALF);
- max_value = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
- LDBL_MAX, DBL_MAX, FLT_MAX);
- min_value = CHOOSE (LDBL_MIN, DBL_MIN, FLT_MIN,
- LDBL_MIN, DBL_MIN, FLT_MIN);
- min_subnorm_value = CHOOSE (__LDBL_DENORM_MIN__,
- __DBL_DENORM_MIN__,
- __FLT_DENORM_MIN__,
- __LDBL_DENORM_MIN__,
- __DBL_DENORM_MIN__,
- __FLT_DENORM_MIN__);
-
- (void) &plus_zero;
- (void) &qnan_value;
- (void) &minus_zero;
- (void) &plus_infty;
- (void) &minus_infty;
- (void) &max_value;
- (void) &min_value;
- (void) &min_subnorm_value;
-
/* Clear all exceptions. From now on we must not get random exceptions. */
feclearexcept (FE_ALL_EXCEPT);
errno = 0;
@@ -14197,10 +14170,6 @@
printf (" %d test cases plus %d tests for exception flags and\n"
" %d tests for errno executed.\n",
noTests, noExcTests, noErrnoTests);
- if (noXFails)
- printf (" %d expected failures occurred.\n", noXFails);
- if (noXPasses)
- printf (" %d unexpected passes occurred.\n", noXPasses);
if (noErrors)
{
printf (" %d errors occurred.\n", noErrors);
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits