2 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4 # Contributed by Andreas Jaeger <aj@suse.de>, 1999.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <http://www.gnu.org/licenses/>.
20 # This file needs to be tidied up
21 # Note that functions and tests share the same namespace.
23 # Information about tests are stored in: %results
24 # $results{$test}{"type"} is the result type, e.g. normal or complex.
25 # $results{$test}{"has_ulps"} is set if deltas exist.
26 # In the following description $type and $float are:
27 # - $type is either "normal", "real" (for the real part of a complex number)
28 # or "imag" (for the imaginary part # of a complex number).
29 # - $float is either of float, ifloat, double, idouble, ldouble, ildouble;
30 # It represents the underlying floating point type (float, double or long
31 # double) and if inline functions (the leading i stands for inline)
33 # $results{$test}{$type}{"ulp"}{$float} is defined and has a delta as value
40 use vars qw
($input $output $auto_input);
41 use vars qw
(%results);
42 use vars qw
(%beautify @all_floats %all_floats_pfx);
43 use vars qw
($output_dir $ulps_file $srcdir);
44 use vars qw
(%auto_tests);
46 # all_floats is sorted and contains all recognised float types
47 @all_floats = ('double', 'float', 'idouble',
48 'ifloat', 'ildouble', 'ldouble');
50 # all_floats_pfx maps C types to their C like prefix for macros.
58 ( "minus_zero" => "-0",
66 "minus_infty" => "-inf",
67 "plus_infty" => "inf",
68 "qnan_value" => "qNaN",
69 "snan_value" => "sNaN",
70 "snan_value_ld" => "sNaN",
79 # n: generate new ulps file
80 use vars
qw($opt_u $opt_h $opt_o $opt_n);
83 $ulps_file = 'libm-test-ulps';
85 ($srcdir = $0) =~ s{[^/]*$}{};
88 print "Usage: gen-libm-test.pl [OPTIONS]\n";
89 print " -h print this help, then exit\n";
90 print " -o DIR directory where generated files will be placed\n";
91 print " -n only generate sorted file NewUlps from libm-test-ulps\n";
92 print " -u FILE input file with ulps\n";
96 $ulps_file = $opt_u if ($opt_u);
97 $output_dir = $opt_o if ($opt_o);
99 $input = "libm-test.inc";
100 $auto_input = "${srcdir}auto-libm-test-out";
101 $output = "${output_dir}libm-test.c";
103 &parse_ulps ($ulps_file);
104 &parse_auto_input ($auto_input);
105 &generate_testfile ($input, $output) unless ($opt_n);
106 &output_ulps ("${output_dir}libm-test-ulps.h", $ulps_file) unless ($opt_n);
107 &print_ulps_file ("${output_dir}NewUlps") if ($opt_n);
109 # Return a nicer representation
114 if (exists $beautify{$arg}) {
115 return $beautify{$arg};
120 if (exists $beautify{$tmp}) {
121 return '-' . $beautify{$tmp};
124 if ($arg =~ /^-?0x[0-9a-f.]*p[-+][0-9]+f$/) {
127 if ($arg =~ /[0-9]L$/) {
133 # Return a nicer representation of a complex number
134 sub build_complex_beautify {
138 $str1 = &beautify ($r);
139 $str2 = &beautify ($i);
142 $str1 .= ' - ' . $str2;
144 $str1 .= ' + ' . $str2;
150 # Return the text to put in an initializer for a test's exception
152 sub show_exceptions {
153 my ($ignore_result, $non_finite, $test_snan, $exception) = @_;
154 $ignore_result = ($ignore_result ? "IGNORE_RESULT|" : "");
155 $non_finite = ($non_finite ? "NON_FINITE|" : "");
156 $test_snan = ($test_snan ? "TEST_SNAN|" : "");
157 if (defined $exception) {
158 return ", ${ignore_result}${non_finite}${test_snan}$exception";
160 return ", ${ignore_result}${non_finite}${test_snan}0";
164 # Apply the LIT(x) macro to a literal floating point constant
165 # and strip any existing suffix.
168 my $exp_re = "([+-])?[[:digit:]]+";
169 # Don't wrap something that does not look like a:
170 # * Hexadecimal FP value
171 # * Decimal FP value without a decimal point
172 # * Decimal value with a fraction
173 return $lit if $lit !~ /([+-])?0x[[:xdigit:]\.]+[pP]$exp_re/
174 and $lit !~ /[[:digit:]]+[eE]$exp_re/
175 and $lit !~ /[[:digit:]]*\.[[:digit:]]*([eE]$exp_re)?/;
177 # Strip any existing literal suffix.
180 return "LIT (${lit})";
183 # Apply LIT macro to individual tokens within an expression.
185 # This function assumes the C expression follows GNU coding
186 # standards. Specifically, a space separates each lexical
187 # token. Otherwise, this post-processing may apply LIT
188 # incorrectly, or around an entire expression.
191 my @toks = split (/ /, $lit);
193 $_ = _apply_lit ($_);
195 return join (' ', @toks);
198 # Parse the arguments to TEST_x_y
200 my ($file, $descr, $args) = @_;
201 my (@args, $descr_args, $descr_res, @descr);
202 my ($current_arg, $cline, $cline_res, $i);
205 my ($ignore_result_any, $ignore_result_all);
206 my ($num_res, @args_res, @start_rm, $rm);
207 my (@plus_oflow, @minus_oflow, @plus_uflow, @minus_uflow);
208 my (@errno_plus_oflow, @errno_minus_oflow);
209 my (@errno_plus_uflow, @errno_minus_uflow);
210 my ($non_finite, $test_snan);
212 ($descr_args, $descr_res) = split /_/,$descr, 2;
214 @args = split /,\s*/, $args;
218 # Generate first the string that's shown to the user
220 @descr = split //,$descr_args;
221 for ($i = 0; $i <= $#descr; $i++) {
223 if ($current_arg > 1) {
226 # FLOAT, long double, int, unsigned int, long int, long long int
227 if ($descr[$i] =~ /f|j|i|u|l|L/) {
228 $call_args .= $comma . &beautify ($args[$current_arg]);
232 # Argument passed via pointer.
233 if ($descr[$i] =~ /p/) {
236 # &FLOAT, &int - simplify call by not showing argument.
237 if ($descr[$i] =~ /F|I/) {
241 if ($descr[$i] eq 'c') {
242 $call_args .= $comma . &build_complex_beautify ($args[$current_arg], $args[$current_arg+1]);
247 die ("$descr[$i] is unknown");
251 @args_res = @args[$current_arg .. $#args];
253 @descr = split //,$descr_res;
255 if ($_ =~ /f|i|l|L|M|U/) {
257 } elsif ($_ eq 'c') {
259 } elsif ($_ eq 'b') {
262 } elsif ($_ eq '1') {
265 die ("$_ is unknown");
269 if ($#args_res == $num_res - 1) {
270 # One set of results for all rounding modes, no flags.
271 @start_rm = ( 0, 0, 0, 0 );
272 } elsif ($#args_res == $num_res) {
273 # One set of results for all rounding modes, with flags.
274 die ("wrong number of arguments")
275 unless ($args_res[$#args_res] =~ /EXCEPTION|ERRNO|IGNORE_ZERO_INF_SIGN|TEST_NAN_SIGN|NO_TEST_INLINE|XFAIL_TEST/);
276 @start_rm = ( 0, 0, 0, 0 );
277 } elsif ($#args_res == 4 * $num_res + 3) {
278 # One set of results per rounding mode, with flags.
279 @start_rm = ( 0, $num_res + 1, 2 * $num_res + 2, 3 * $num_res + 3 );
281 die ("wrong number of arguments");
284 # Put the C program line together
285 # Reset some variables to start again
287 $call_args =~ s/\"/\\\"/g;
288 $cline = "{ \"$call_args\"";
289 @descr = split //,$descr_args;
290 for ($i=0; $i <= $#descr; $i++) {
291 # FLOAT, int, long int, long long int
292 if ($descr[$i] =~ /f|j|i|u|l|L/) {
293 if ($descr[$i] eq "f") {
294 $cline .= ", " . &apply_lit ($args[$current_arg]);
296 $cline .= ", $args[$current_arg]";
301 # &FLOAT, &int, argument passed via pointer
302 if ($descr[$i] =~ /F|I|p/) {
306 if ($descr[$i] eq 'c') {
307 $cline .= ", " . &apply_lit ($args[$current_arg]);
308 $cline .= ", " . &apply_lit ($args[$current_arg+1]);
314 @descr = split //,$descr_res;
315 @plus_oflow = qw(max_value plus_infty max_value plus_infty);
316 @minus_oflow = qw(minus_infty minus_infty -max_value -max_value);
317 @plus_uflow = qw(plus_zero plus_zero plus_zero min_subnorm_value);
318 @minus_uflow = qw(-min_subnorm_value minus_zero minus_zero minus_zero);
319 @errno_plus_oflow = qw(0 ERRNO_ERANGE 0 ERRNO_ERANGE);
320 @errno_minus_oflow = qw(ERRNO_ERANGE ERRNO_ERANGE 0 0);
321 @errno_plus_uflow = qw(ERRNO_ERANGE ERRNO_ERANGE ERRNO_ERANGE 0);
322 @errno_minus_uflow = qw(0 ERRNO_ERANGE ERRNO_ERANGE ERRNO_ERANGE);
323 for ($rm = 0; $rm <= 3; $rm++) {
324 $current_arg = $start_rm[$rm];
325 $ignore_result_any = 0;
326 $ignore_result_all = 1;
330 if ($_ =~ /b|f|j|i|l|L|M|U/ ) {
331 my ($result) = $args_res[$current_arg];
332 if ($result eq "IGNORE") {
333 $ignore_result_any = 1;
336 $ignore_result_all = 0;
339 $result = apply_lit
($result);
341 $cline_res .= ", $result";
343 } elsif ($_ eq 'c') {
344 my ($result1) = $args_res[$current_arg];
345 if ($result1 eq "IGNORE") {
346 $ignore_result_any = 1;
349 $ignore_result_all = 0;
351 my ($result2) = $args_res[$current_arg + 1];
352 if ($result2 eq "IGNORE") {
353 $ignore_result_any = 1;
356 $ignore_result_all = 0;
358 $result1 = apply_lit
($result1);
359 $result2 = apply_lit
($result2);
360 $cline_res .= ", $result1, $result2";
362 } elsif ($_ eq '1') {
363 push @special, $args_res[$current_arg];
367 if ($ignore_result_any && !$ignore_result_all) {
368 die ("some but not all function results ignored\n");
370 # Determine whether any arguments or results, for any rounding
371 # mode, are non-finite.
372 $non_finite = ($args =~ /qnan_value|snan_value|plus_infty|minus_infty/);
373 $test_snan = ($args =~ /snan_value/);
375 $cline_res .= show_exceptions
($ignore_result_any,
378 ($current_arg <= $#args_res)
379 ?
$args_res[$current_arg]
382 # special treatment for some functions
386 my ($extra_expected) = $_;
387 my ($run_extra) = ($extra_expected ne "IGNORE" ?
1 : 0);
389 $extra_expected = "0";
391 $extra_expected = apply_lit
($extra_expected);
393 $cline_res .= ", $run_extra, $extra_expected";
395 $cline_res =~ s/^, //;
396 $cline_res =~ s/plus_oflow/$plus_oflow[$rm]/g;
397 $cline_res =~ s/minus_oflow/$minus_oflow[$rm]/g;
398 $cline_res =~ s/plus_uflow/$plus_uflow[$rm]/g;
399 $cline_res =~ s/minus_uflow/$minus_uflow[$rm]/g;
400 $cline_res =~ s/ERRNO_PLUS_OFLOW/$errno_plus_oflow[$rm]/g;
401 $cline_res =~ s/ERRNO_MINUS_OFLOW/$errno_minus_oflow[$rm]/g;
402 $cline_res =~ s/ERRNO_PLUS_UFLOW/$errno_plus_uflow[$rm]/g;
403 $cline_res =~ s/ERRNO_MINUS_UFLOW/$errno_minus_uflow[$rm]/g;
404 $cline .= ", { $cline_res }";
406 print $file " $cline },\n";
409 # Convert a condition from auto-libm-test-out to C form.
410 sub convert_condition
{
413 @conds = split /:/, $cond;
418 $ret = join " && ", @conds;
422 # Return text to OR a value into an accumulated flags string.
432 # Return a conditional expression between two values.
434 my ($cond, $if, $else) = @_;
437 } elsif ($cond eq "0") {
440 return "($cond ? $if : $else)";
444 # Return text to OR a conditional expression between two values into
445 # an accumulated flags string.
447 my ($cond, $if, $else) = @_;
448 return or_value
(cond_value
($cond, $if, $else));
451 # Generate libm-test.c
452 sub generate_testfile
{
453 my ($input, $output) = @_;
455 open INPUT
, $input or die ("Can't open $input: $!");
456 open OUTPUT
, ">$output" or die ("Can't open $output: $!");
458 # Replace the special macros
460 # AUTO_TESTS (function),
461 if (/^\s*AUTO_TESTS_/) {
462 my ($descr, $func, @modes, $auto_test, $num_auto_tests);
463 my (@rm_tests, $rm, $i);
464 @modes = qw(downward tonearest towardzero upward);
465 ($descr, $func) = ($_ =~ /AUTO_TESTS_(\w+)\s*\((\w+)\)/);
466 for ($rm = 0; $rm <= 3; $rm++) {
467 $rm_tests[$rm] = [sort keys %{$auto_tests{$func}{$modes[$rm]}}];
469 $num_auto_tests = scalar @
{$rm_tests[0]};
470 for ($rm = 1; $rm <= 3; $rm++) {
471 if ($num_auto_tests != scalar @
{$rm_tests[$rm]}) {
472 die ("inconsistent numbers of tests for $func\n");
474 for ($i = 0; $i < $num_auto_tests; $i++) {
475 if ($rm_tests[0][$i] ne $rm_tests[$rm][$i]) {
476 die ("inconsistent list of tests of $func\n");
480 if ($num_auto_tests == 0) {
481 die ("no automatic tests for $func\n");
483 foreach $auto_test (@
{$rm_tests[0]}) {
484 my ($format, $inputs, $format_conv, $args_str);
485 ($format, $inputs) = split / /, $auto_test, 2;
487 $format_conv = convert_condition
($format);
488 print OUTPUT
"#if $format_conv\n";
489 $args_str = "$func, $inputs";
490 for ($rm = 0; $rm <= 3; $rm++) {
491 my ($auto_test_out, $outputs, $flags);
492 my ($flags_conv, @flags, %flag_cond);
493 $auto_test_out = $auto_tests{$func}{$modes[$rm]}{$auto_test};
494 ($outputs, $flags) = split / : */, $auto_test_out;
495 $outputs =~ s/ /, /g;
496 @flags = split / /, $flags;
498 if (/^([^:]*):(.*)$/) {
501 $cond = convert_condition
($2);
502 if (defined ($flag_cond{$flag})) {
503 if ($flag_cond{$flag} ne "1") {
504 $flag_cond{$flag} .= " || $cond";
507 $flag_cond{$flag} = $cond;
510 $flag_cond{$_} = "1";
514 if (defined ($flag_cond{"ignore-zero-inf-sign"})) {
515 $flags_conv .= or_cond_value
($flag_cond{"ignore-zero-inf-sign"},
516 "IGNORE_ZERO_INF_SIGN", "0");
518 if (defined ($flag_cond{"no-test-inline"})) {
519 $flags_conv .= or_cond_value
($flag_cond{"no-test-inline"},
520 "NO_TEST_INLINE", "0");
522 if (defined ($flag_cond{"xfail"})) {
523 $flags_conv .= or_cond_value
($flag_cond{"xfail"},
526 my (@exc_list) = qw(divbyzero inexact invalid overflow underflow);
528 foreach $exc (@exc_list) {
529 my ($exc_expected, $exc_ok, $no_exc, $exc_cond, $exc_ok_cond);
530 $exc_expected = "\U$exc\E_EXCEPTION";
531 $exc_ok = "\U$exc\E_EXCEPTION_OK";
533 if ($exc eq "inexact") {
535 $no_exc = "NO_INEXACT_EXCEPTION";
537 if (defined ($flag_cond{$exc})) {
538 $exc_cond = $flag_cond{$exc};
542 if (defined ($flag_cond{"$exc-ok"})) {
543 $exc_ok_cond = $flag_cond{"$exc-ok"};
547 $flags_conv .= or_cond_value
($exc_cond,
548 cond_value
($exc_ok_cond,
549 $exc_ok, $exc_expected),
550 cond_value
($exc_ok_cond,
553 my ($errno_expected, $errno_unknown_cond);
554 if (defined ($flag_cond{"errno-edom"})) {
555 if ($flag_cond{"errno-edom"} ne "1") {
556 die ("unexpected condition for errno-edom");
558 if (defined ($flag_cond{"errno-erange"})) {
559 die ("multiple errno values expected");
561 $errno_expected = "ERRNO_EDOM";
562 } elsif (defined ($flag_cond{"errno-erange"})) {
563 if ($flag_cond{"errno-erange"} ne "1") {
564 die ("unexpected condition for errno-erange");
566 $errno_expected = "ERRNO_ERANGE";
568 $errno_expected = "ERRNO_UNCHANGED";
570 if (defined ($flag_cond{"errno-edom-ok"})) {
571 if (defined ($flag_cond{"errno-erange-ok"})
572 && ($flag_cond{"errno-erange-ok"}
573 ne $flag_cond{"errno-edom-ok"})) {
574 $errno_unknown_cond = "($flag_cond{\"errno-edom-ok\"} || $flag_cond{\"errno-erange-ok\"})";
576 $errno_unknown_cond = $flag_cond{"errno-edom-ok"};
578 } elsif (defined ($flag_cond{"errno-erange-ok"})) {
579 $errno_unknown_cond = $flag_cond{"errno-erange-ok"};
581 $errno_unknown_cond = "0";
583 $flags_conv .= or_cond_value
($errno_unknown_cond,
584 "0", $errno_expected);
585 if ($flags_conv eq "") {
586 $flags_conv = ", NO_EXCEPTION";
588 $flags_conv =~ s/^ \|/,/;
590 $args_str .= ", $outputs$flags_conv";
592 &parse_args
(\
*OUTPUT
, $descr, $args_str);
593 print OUTPUT
"#endif\n";
602 ($descr, $args) = ($_ =~ /TEST_(\w+)\s*\((.*)\)/);
603 &parse_args
(\
*OUTPUT
, $descr, $args);
617 my ($test, $type, $float, $eps, $float_regex);
619 # Build a basic regex to match type entries in the
620 # generated ULPS file.
621 foreach my $ftype (@all_floats) {
622 $float_regex .= "|" . $ftype;
624 $float_regex = "^" . substr ($float_regex, 1) . ":";
626 # $type has the following values:
627 # "normal": No complex variable
628 # "real": Real part of complex result
629 # "imag": Imaginary part of complex result
630 open ULP
, $file or die ("Can't open $file: $!");
633 # ignore comments and empty lines
637 if (/Real part of/) {
640 } elsif (/Imaginary part of/) {
641 s/Imaginary part of //;
646 ($test) = ($_ =~ /^Function:\s*\"([a-zA-Z0-9_]+)\"/);
649 if (/$float_regex/) {
650 ($float, $eps) = split /\s*:\s*/,$_,2;
656 if (!defined ($results{$test}{$type}{'ulp'}{$float})
657 || $results{$test}{$type}{'ulp'}{$float} < $eps) {
658 $results{$test}{$type}{'ulp'}{$float} = $eps;
659 $results{$test}{'has_ulps'} = 1;
662 if ($type =~ /^real|imag$/) {
663 $results{$test}{'type'} = 'complex';
664 } elsif ($type eq 'normal') {
665 $results{$test}{'type'} = 'normal';
669 print "Skipping unknown entry: `$_'\n";
675 # Clean up a floating point number
676 sub clean_up_number
{
679 # Remove trailing zeros after the decimal point
680 if ($number =~ /\./) {
687 # Output a file which can be read in as ulps file.
688 sub print_ulps_file
{
690 my ($test, $type, $float, $eps, $fct, $last_fct);
693 open NEWULP
, ">$file" or die ("Can't open $file: $!");
694 print NEWULP
"# Begin of automatic generation\n";
695 print NEWULP
"\n# Maximal error of functions:\n";
697 foreach $fct (sort keys %results) {
698 foreach $type ('real', 'imag', 'normal') {
699 if (exists $results{$fct}{$type}) {
700 if ($type eq 'normal') {
701 print NEWULP
"Function: \"$fct\":\n";
702 } elsif ($type eq 'real') {
703 print NEWULP
"Function: Real part of \"$fct\":\n";
704 } elsif ($type eq 'imag') {
705 print NEWULP
"Function: Imaginary part of \"$fct\":\n";
707 foreach $float (@all_floats) {
708 if (exists $results{$fct}{$type}{'ulp'}{$float}) {
709 print NEWULP
"$float: ",
710 &clean_up_number
($results{$fct}{$type}{'ulp'}{$float}),
718 print NEWULP
"# end of automatic generation\n";
723 my ($test, $type, $float) = @_;
725 return (exists $results{$test}{$type}{'ulp'}{$float}
726 ?
$results{$test}{$type}{'ulp'}{$float} : "0");
729 # Return the ulps value for a single test.
730 sub get_all_ulps_for_test
{
731 my ($test, $type) = @_;
732 my ($ldouble, $double, $float, $ildouble, $idouble, $ifloat);
735 if (exists $results{$test}{'has_ulps'}) {
736 foreach $float (@all_floats) {
737 $ulps_str .= &get_ulps
($test, $type, $float) . ", ";
739 return "{" . substr ($ulps_str, 0, -2) . "}";
741 die "get_all_ulps_for_test called for \"$test\" with no ulps\n";
747 my ($file, $ulps_filename) = @_;
748 my ($i, $fct, $type, $ulp, $ulp_real, $ulp_imag);
749 my (%func_ulps, %func_real_ulps, %func_imag_ulps);
751 open ULP
, ">$file" or die ("Can't open $file: $!");
753 print ULP
"/* This file is automatically generated\n";
754 print ULP
" from $ulps_filename with gen-libm-test.pl.\n";
755 print ULP
" Don't change it - change instead the master files. */\n\n";
757 print ULP
"struct ulp_data\n";
759 print ULP
" const char *name;\n";
760 print ULP
" FLOAT max_ulp[" . @all_floats . "];\n";
763 for ($i = 0; $i <= $#all_floats; $i++) {
764 $type = $all_floats[$i];
765 print ULP
"#define ULP_";
768 $type = substr $type, 1;
770 print ULP
"$all_floats_pfx{$type} $i\n";
773 foreach $fct (keys %results) {
774 $type = $results{$fct}{'type'};
775 if ($type eq 'normal') {
776 $ulp = get_all_ulps_for_test
($fct, 'normal');
777 } elsif ($type eq 'complex') {
778 $ulp_real = get_all_ulps_for_test
($fct, 'real');
779 $ulp_imag = get_all_ulps_for_test
($fct, 'imag');
781 die "unknown results ($fct) type $type\n";
783 if ($type eq 'normal') {
784 $func_ulps{$fct} = $ulp;
786 $func_real_ulps{$fct} = $ulp_real;
787 $func_imag_ulps{$fct} = $ulp_imag;
790 print ULP
"\n/* Maximal error of functions. */\n";
791 print ULP
"static const struct ulp_data func_ulps[] =\n {\n";
792 foreach $fct (sort keys %func_ulps) {
793 print ULP
" { \"$fct\", $func_ulps{$fct} },\n";
796 print ULP
"static const struct ulp_data func_real_ulps[] =\n {\n";
797 foreach $fct (sort keys %func_real_ulps) {
798 print ULP
" { \"$fct\", $func_real_ulps{$fct} },\n";
801 print ULP
"static const struct ulp_data func_imag_ulps[] =\n {\n";
802 foreach $fct (sort keys %func_imag_ulps) {
803 print ULP
" { \"$fct\", $func_imag_ulps{$fct} },\n";
809 # Parse auto-libm-test-out.
810 sub parse_auto_input
{
812 open AUTO
, $file or die ("Can't open $file: $!");
817 if (/^(\S+) (\S+) ([^:]*) : (.*)$/) {
818 $auto_tests{$1}{$2}{$3} = $4;
820 die ("bad automatic test line: $_\n");