summaryrefslogtreecommitdiff
path: root/libc/math/gen-libm-test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'libc/math/gen-libm-test.pl')
-rwxr-xr-xlibc/math/gen-libm-test.pl24
1 files changed, 15 insertions, 9 deletions
diff --git a/libc/math/gen-libm-test.pl b/libc/math/gen-libm-test.pl
index 86d95078d..d422770c4 100755
--- a/libc/math/gen-libm-test.pl
+++ b/libc/math/gen-libm-test.pl
@@ -206,22 +206,24 @@ sub special_functions {
unless ($args[0] =~ /sincos/) {
die ("Don't know how to handle $args[0] extra.");
}
- print $file " FUNC (sincos) ($args[1], &sin_res, &cos_res);\n";
+ print $file " {\n";
+ print $file " FUNC (sincos) ($args[1], &sin_res, &cos_res);\n";
$str = 'sincos (' . &beautify ($args[1]) . ', &sin_res, &cos_res)';
# handle sin
$test = $str . ' puts ' . &beautify ($args[2]) . ' in sin_res';
- $cline = " check_float (\"$test\", sin_res, $args[2]";
+ $cline = " check_float (\"$test\", sin_res, $args[2]";
$cline .= &new_test ($test, $args[4]);
print $file $cline;
# handle cos
$test = $str . ' puts ' . &beautify ($args[3]) . ' in cos_res';
- $cline = " check_float (\"$test\", cos_res, $args[3]";
+ $cline = " check_float (\"$test\", cos_res, $args[3]";
# only tests once for exception
$cline .= &new_test ($test, undef);
print $file $cline;
+ print $file " }\n";
}
# Parse the arguments to TEST_x_y
@@ -323,7 +325,7 @@ sub parse_args {
}
# Special handling for some macros:
$cline .= " (\"$str\", ";
- if ($args[0] =~ /fpclassify|isnormal|isfinite|isinf|isnan|signbit
+ if ($args[0] =~ /fpclassify|isnormal|isfinite|isinf|isnan|issignaling|signbit
|isgreater|isgreaterequal|isless|islessequal
|islessgreater|isunordered/x) {
$c_call = "$args[0] (";
@@ -401,11 +403,15 @@ sub parse_args {
}
}
- print $file $pre if (defined $pre);
-
- print $file " $cline";
-
- print $file $post if (defined $post);
+ if (defined $pre or defined $post) {
+ print $file " {\n";
+ print $file " $pre" if (defined $pre);
+ print $file " $cline";
+ print $file " $post" if (defined $post);
+ print $file " }\n";
+ } else {
+ print $file " $cline";
+ }
}
# Generate libm-test.c