From 12b64309cfa2289e57d439ec9f2d645c59f7bcf1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 27 Jan 2001 00:15:16 +0000 Subject: Update. * conform/conformtest.pl: Implement optional-macro. * conform/data/math.h-data: Update for XPG6. * math/math.h (HUGE): Define as FLT_MAX value but don't use FLT_MAX. Don't include . (MAXFLOAT): Likewise. * math/math.h: Define MATH_ERRNO and MATH_ERREXCEPT. --- conform/conformtest.pl | 56 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) (limited to 'conform/conformtest.pl') diff --git a/conform/conformtest.pl b/conform/conformtest.pl index 6aade40c55..cfb23f2602 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -361,7 +361,7 @@ while ($#headers >= 0) { $res = compiletest ($fnamebase, "Testing for constant $const", "NOT PRESENT", $res, 1); - if ($value ne "") { + if ($value ne "" && $res == 0) { # Generate a program to test for the value of this constant. open (TESTFILE, ">$fnamebase.c"); print TESTFILE "$prepend"; @@ -373,7 +373,7 @@ while ($#headers >= 0) { $res = runtest ($fnamebase, "Testing for value of constant $const", "Constant \"$const\" has not the right value.", $res); } - } elsif (/^constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_]*)/) { + } elsif (/^constant *([a-zA-Z0-9_]*) *([>=<]+) ([A-Za-z0-9_]*)/) { my($const) = $1; my($op) = $2; my($value) = $3; @@ -464,7 +464,7 @@ while ($#headers >= 0) { $res = compiletest ($fnamebase, "Testing for constant $const", "NOT PRESENT", $res, 1); - if ($value ne "") { + if ($value ne "" && $res == 0) { # Generate a program to test for the value of this constant. open (TESTFILE, ">$fnamebase.c"); print TESTFILE "$prepend"; @@ -726,6 +726,56 @@ while ($#headers >= 0) { $res = runtest ($fnamebase, "Testing for value of macro $macro", "Macro \"$macro\" has not the right value.", $res); + } elsif (/^optional-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", + "NOT PRESENT", $missing, 1); + } elsif (/^macro *([a-zA-Z0-9_]*) *([>=<]+) ([A-Za-z0-9_]*)/) { + my($macro) = "$1"; + my($op) = $2; + my($value) = $3; + 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", + "Macro \"$macro\" is not available.", $res, 0); + + if ($value ne "") { + # 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 $op $value); }\n"; + close (TESTFILE); + + $res = runtest ($fnamebase, "Testing for value of constant $macro", + "Macro \"$macro\" has not the right value.", $res); + } } elsif (/^macro *([^ ]*)/) { my($macro) = "$1"; -- cgit 1.4.1