]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/gen-libm-test.pl
XFAIL libm-test.inc tests as needed for ibm128.
[thirdparty/glibc.git] / math / gen-libm-test.pl
index 4d02873c6f52a8a541ddf29b30992880a1c195eb..a58194dfd61a9c0ab3568b5825601cb25f962d76 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 1999-2016 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Andreas Jaeger <aj@suse.de>, 1999.
 
@@ -207,6 +207,7 @@ sub parse_args {
   my (@plus_oflow, @minus_oflow, @plus_uflow, @minus_uflow);
   my (@errno_plus_oflow, @errno_minus_oflow);
   my (@errno_plus_uflow, @errno_minus_uflow);
+  my (@xfail_rounding_ibm128_libgcc);
   my ($non_finite, $test_snan);
 
   ($descr_args, $descr_res) = split /_/,$descr, 2;
@@ -223,12 +224,16 @@ sub parse_args {
     if ($current_arg > 1) {
       $comma = ', ';
     }
-    # FLOAT, int, long int, long long int
-    if ($descr[$i] =~ /f|j|i|l|L/) {
+    # FLOAT, long double, int, unsigned int, long int, long long int
+    if ($descr[$i] =~ /f|j|i|u|l|L/) {
       $call_args .= $comma . &beautify ($args[$current_arg]);
       ++$current_arg;
       next;
     }
+    # Argument passed via pointer.
+    if ($descr[$i] =~ /p/) {
+      next;
+    }
     # &FLOAT, &int - simplify call by not showing argument.
     if ($descr[$i] =~ /F|I/) {
       next;
@@ -248,7 +253,7 @@ sub parse_args {
   $num_res = 0;
   @descr = split //,$descr_res;
   foreach (@descr) {
-    if ($_ =~ /f|i|l|L/) {
+    if ($_ =~ /f|i|l|L|M|U/) {
       ++$num_res;
     } elsif ($_ eq 'c') {
       $num_res += 2;
@@ -268,7 +273,7 @@ sub parse_args {
   } elsif ($#args_res == $num_res) {
     # One set of results for all rounding modes, with flags.
     die ("wrong number of arguments")
-      unless ($args_res[$#args_res] =~ /EXCEPTION|ERRNO|IGNORE_ZERO_INF_SIGN|TEST_NAN_SIGN|NO_TEST_INLINE|XFAIL_TEST/);
+      unless ($args_res[$#args_res] =~ /EXCEPTION|ERRNO|IGNORE_ZERO_INF_SIGN|TEST_NAN_SIGN|NO_TEST_INLINE|XFAIL/);
     @start_rm = ( 0, 0, 0, 0 );
   } elsif ($#args_res == 4 * $num_res + 3) {
     # One set of results per rounding mode, with flags.
@@ -285,7 +290,7 @@ sub parse_args {
   @descr = split //,$descr_args;
   for ($i=0; $i <= $#descr; $i++) {
     # FLOAT, int, long int, long long int
-    if ($descr[$i] =~ /f|j|i|l|L/) {
+    if ($descr[$i] =~ /f|j|i|u|l|L/) {
       if ($descr[$i] eq "f") {
         $cline .= ", " . &apply_lit ($args[$current_arg]);
       } else {
@@ -294,8 +299,8 @@ sub parse_args {
       $current_arg++;
       next;
     }
-    # &FLOAT, &int
-    if ($descr[$i] =~ /F|I/) {
+    # &FLOAT, &int, argument passed via pointer
+    if ($descr[$i] =~ /F|I|p/) {
       next;
     }
     # complex
@@ -316,6 +321,8 @@ sub parse_args {
   @errno_minus_oflow = qw(ERRNO_ERANGE ERRNO_ERANGE 0 0);
   @errno_plus_uflow = qw(ERRNO_ERANGE ERRNO_ERANGE ERRNO_ERANGE 0);
   @errno_minus_uflow = qw(0 ERRNO_ERANGE ERRNO_ERANGE ERRNO_ERANGE);
+  @xfail_rounding_ibm128_libgcc = qw(XFAIL_IBM128_LIBGCC 0
+                                    XFAIL_IBM128_LIBGCC XFAIL_IBM128_LIBGCC);
   for ($rm = 0; $rm <= 3; $rm++) {
     $current_arg = $start_rm[$rm];
     $ignore_result_any = 0;
@@ -323,7 +330,7 @@ sub parse_args {
     $cline_res = "";
     @special = ();
     foreach (@descr) {
-      if ($_ =~ /b|f|j|i|l|L/ ) {
+      if ($_ =~ /b|f|j|i|l|L|M|U/ ) {
        my ($result) = $args_res[$current_arg];
        if ($result eq "IGNORE") {
          $ignore_result_any = 1;
@@ -397,6 +404,7 @@ sub parse_args {
     $cline_res =~ s/ERRNO_MINUS_OFLOW/$errno_minus_oflow[$rm]/g;
     $cline_res =~ s/ERRNO_PLUS_UFLOW/$errno_plus_uflow[$rm]/g;
     $cline_res =~ s/ERRNO_MINUS_UFLOW/$errno_minus_uflow[$rm]/g;
+    $cline_res =~ s/XFAIL_ROUNDING_IBM128_LIBGCC/$xfail_rounding_ibm128_libgcc[$rm]/g;
     $cline .= ", { $cline_res }";
   }
   print $file "    $cline },\n";