summary refs log tree commit diff
path: root/math/gen-libm-test.pl
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2013-03-21 16:07:48 +0100
committerThomas Schwinge <thomas@codesourcery.com>2013-03-21 16:07:48 +0100
commitbdef0be784c57c6e01a64933a167f29b2bd0cd6e (patch)
tree06cb27d5fe4eb20e2cc6a623ea089a88c63e453e /math/gen-libm-test.pl
parent5aa4a1a1fd742479818a668d42d91ca9ec4a6318 (diff)
downloadglibc-bdef0be784c57c6e01a64933a167f29b2bd0cd6e.tar.gz
glibc-bdef0be784c57c6e01a64933a167f29b2bd0cd6e.tar.xz
glibc-bdef0be784c57c6e01a64933a167f29b2bd0cd6e.zip
libm-test: Properly wrap blocks consisting of several statements.
Diffstat (limited to 'math/gen-libm-test.pl')
-rwxr-xr-xmath/gen-libm-test.pl22
1 files changed, 14 insertions, 8 deletions
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index 01e0fc20d3..f50f1d9e02 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -203,22 +203,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
@@ -398,11 +400,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