]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
conformtest: Unify "macro" cases.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 1 May 2012 20:02:19 +0000 (20:02 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 1 May 2012 20:02:19 +0000 (20:02 +0000)
ChangeLog
conform/conformtest.pl
conform/data/stdlib.h-data

index 323b45be3e3deb4ae6bb2e7722a8f130424b9a2d..bb313e1c1e84bc3984ee6f816d6838c5e53817d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-01  Joseph Myers  <joseph@codesourcery.com>
 
+       * conform/conformtest.pl: Only accept expected macro values with
+       "==".  Parse all "macro" lines in one place.
+       * conform/data/stdlib.h-data: Use "==" form on "macro" lines.
+
        * conform/conformtest.pl: Handle braced types on "constant" lines
        instead of handling "typed-constant".
        * conform/data/signal.h-data: Use "constant" instead of
index 0a1a0939902a609becb89bca028b9e90c9e0f68b..c38be1dc5b983e8bf8813d7912a02006851d410b 100644 (file)
@@ -683,7 +683,7 @@ while ($#headers >= 0) {
 
       $res = runtest ($fnamebase, "Testing for value of macro $macro",
                      "Macro \"$macro\" has not the right value.", $res);
-    } elsif (/^macro *([a-zA-Z0-9_]*) *([>=<!]+) ([A-Za-z0-9_]*)/) {
+    } elsif (/^macro *([a-zA-Z0-9_]*) *(?:([>=<!]+) ([A-Za-z0-9_]*))?/) {
       my($macro) = "$1";
       my($op) = $2;
       my($value) = $3;
@@ -707,7 +707,7 @@ while ($#headers >= 0) {
                           : "Macro \"$macro\" is not available."), $res,
                          $optional);
 
-      if ($value ne "" && ($res == 0 || !$optional)) {
+      if (defined ($op) && ($res == 0 || !$optional)) {
        # Generate a program to test for the value of this constant.
        open (TESTFILE, ">$fnamebase.c");
        print TESTFILE "$prepend";
@@ -719,61 +719,6 @@ while ($#headers >= 0) {
        $res = runtest ($fnamebase, "Testing for value of macro $macro",
                        "Macro \"$macro\" has not the right value.", $res);
       }
-    } elsif (/^macro *([a-zA-Z0-9_]*) *([A-Za-z0-9_]*)/) {
-      my($macro) = "$1";
-      my($value) = $2;
-      my($res) = $missing;
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      $res = compiletest ($fnamebase, "Test availability of macro $macro",
-                         ($optional
-                          ? "NOT PRESENT"
-                          : "Macro \"$macro\" is not available."), $res,
-                         $optional);
-
-      if ($value ne "" && ($res == 0 || !$optional)) {
-       # Generate a program to test for the value of this constant.
-       open (TESTFILE, ">$fnamebase.c");
-       print TESTFILE "$prepend";
-       print TESTFILE "#include <$h>\n";
-       # Negate the value since 0 means ok
-       print TESTFILE "int main (void) { return !($macro == $value); }\n";
-       close (TESTFILE);
-
-       $res = runtest ($fnamebase, "Testing for value of macro $macro",
-                       "Macro \"$macro\" has not the right value.", $res);
-      }
-    } elsif (/^macro *([^      ]*)/) {
-      my($macro) = "$1";
-
-      # Remember that this name is allowed.
-      push @allow, $macro;
-
-      # Generate a program to test for availability of this macro.
-      open (TESTFILE, ">$fnamebase.c");
-      print TESTFILE "$prepend";
-      print TESTFILE "#include <$h>\n";
-      print TESTFILE "#ifndef $macro\n";
-      print TESTFILE "# error \"Macro $macro not defined\"\n";
-      print TESTFILE "#endif\n";
-      close (TESTFILE);
-
-      compiletest ($fnamebase, "Test availability of macro $macro",
-                  ($optional
-                   ? "NOT PRESENT"
-                   : "Macro \"$macro\" is not available."), $missing,
-                  $optional);
     } elsif (/^allow-header *(.*)/) {
       my($pattern) = $1;
       if ($seenheader{$pattern} != 1) {
@@ -827,7 +772,7 @@ while ($#headers >= 0) {
        push @allow, $4;
       } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
        push @allow, $4;
-      } elsif (/^macro *([^    ]*)/) {
+      } elsif (/^macro *([a-zA-Z0-9_]*) *(?:([>=<!]+) ([A-Za-z0-9_]*))?/) {
        push @allow, $1;
       } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
        push @allow, $1;
index f42d4a7ac4500ec5aeaa1cc3ad9c59f5e01046aa..f13bf3c292547677f6ce3a08d2d12fb2ad286177 100644 (file)
@@ -6,7 +6,7 @@ element ldiv_t long quot
 element ldiv_t long rem
 
 macro EXIT_FAILURE
-macro EXIT_SUCCESS 0
+macro EXIT_SUCCESS == 0
 
 macro NULL
 constant RAND_MAX >= 32767