about summary refs log tree commit diff
path: root/conform/conformtest.pl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-01-09 10:56:41 -0800
committerUlrich Drepper <drepper@redhat.com>2010-01-09 10:56:41 -0800
commitf095bb7204d80f609a73a22796edd6cffd4c6add (patch)
tree2b909bba9e4857eaee4761cacc16a69e7ecd480a /conform/conformtest.pl
parent44dcc00292b965b3b6bff8415175d6a3e290aab7 (diff)
downloadglibc-f095bb7204d80f609a73a22796edd6cffd4c6add.tar.gz
glibc-f095bb7204d80f609a73a22796edd6cffd4c6add.tar.xz
glibc-f095bb7204d80f609a73a22796edd6cffd4c6add.zip
Add support for XPG7 testing.
The header conformance testing code needed extending for XPG7.  This
exposed a few bugs in the headers.  There are more changes to come.
Diffstat (limited to 'conform/conformtest.pl')
-rw-r--r--conform/conformtest.pl38
1 files changed, 30 insertions, 8 deletions
diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index b15656bd60..e594d87972 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -1,6 +1,7 @@
 #! /usr/bin/perl
 
 use Getopt::Long;
+use POSIX;
 
 $CC = "gcc";
 
@@ -30,7 +31,8 @@ if (@headers == ()) {
 }
 
 if ($dialect ne "ISO" && $dialect ne "POSIX" && $dialect ne "XPG3"
-    && $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K") {
+    && $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K"
+    && $dialect ne "XOPEN2K8" && $dialect ne "POSIX2008") {
   die "unknown dialect \"$dialect\"";
 }
 
@@ -40,6 +42,8 @@ $CFLAGS{"XPG3"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE";
 $CFLAGS{"XPG4"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE_EXTENDED";
 $CFLAGS{"UNIX98"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=500";
 $CFLAGS{"XOPEN2K"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
+$CFLAGS{"XOPEN2K8"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=700";
+$CFLAGS{"POSIX2008"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_POSIX_C_SOURCE=200809L";
 
 
 # These are the ISO C99 keywords.
@@ -71,7 +75,10 @@ while ($#knownproblems >= 0) {
   $isknown{pop (@knownproblems)} = 1;
 }
 
-$tmpdir = "/tmp";
+$uid = getuid();
+($pwname,$pwpasswd,$pwuid,$pwgid,
+ $pwquota,$pwcomment,$pwgcos,$pwdir,$pwshell,$pwexpire) = getpwuid($uid);
+$tmpdir = "$pwdir";
 
 $verbose = 1;
 
@@ -660,9 +667,6 @@ while ($#headers >= 0) {
 	$maybe_opaque = 1;
       }
 
-      # Remember that this name is allowed.
-      push @allow, $type;
-
       # Generate a program to test for the availability of this constant.
       open (TESTFILE, ">$fnamebase.c");
       print TESTFILE "$prepend";
@@ -690,9 +694,6 @@ while ($#headers >= 0) {
 	$maybe_opaque = 1;
       }
 
-      # Remember that this name is allowed.
-      push @allow, $type;
-
       # Generate a program to test for the availability of this type.
       open (TESTFILE, ">$fnamebase.c");
       print TESTFILE "$prepend";
@@ -706,6 +707,27 @@ while ($#headers >= 0) {
 
       compiletest ($fnamebase, "Testing for type $type",
 		   "Type \"$type\" not available.", $missing, 0);
+    } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) {
+      my($type) = "$2$3";
+
+      # Remember that this name is allowed.
+      if ($type =~ /^struct *(.*)/) {
+	push @allow, $1;
+      } elsif ($type =~ /^union *(.*)/) {
+	push @allow, $1;
+      } else {
+	push @allow, $type;
+      }
+
+      # Generate a program to test for the availability of this type.
+      open (TESTFILE, ">$fnamebase.c");
+      print TESTFILE "$prepend";
+      print TESTFILE "#include <$h>\n";
+      print TESTFILE "$type;\n";
+      close (TESTFILE);
+
+      compiletest ($fnamebase, "Testing for type $type",
+		   "Type \"$type\" not available.", $missing, 0);
     } elsif (/^optional-function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
       my($rettype) = "$2$3";
       my($fname) = "$4";