This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

conformtest: Support specifying types before promotion


Some standard macros, in particular in limits.h and stdint.h, have
types specified to be the result of applying the integer promotions to
a given type.  To represent this in the conformtest inputs, there
should be a notation to represent "the result of applying the integer
promotions to type T".

I propose this patch to implement this.  Tested x86_64.

2012-04-28  Joseph Myers  <joseph@codesourcery.com>

	* conform/conformtest.pl: If macro or constant types start
	"promoted:", expect the symbol to be of the following type
	promoted by the integer promotions.

diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index f5860ac..2d8cfd7 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -437,7 +437,12 @@ while ($#headers >= 0) {
 	open (TESTFILE, ">$fnamebase.c");
 	print TESTFILE "$prepend";
 	print TESTFILE "#include <$h>\n";
-	print TESTFILE "__typeof__ (($type) 0) a;\n";
+	if ($type =~ /^promoted:/) {
+	  $type =~ s/^promoted://;
+	  print TESTFILE "__typeof__ (($type) 0 + ($type) 0) a;\n";
+	} else {
+	  print TESTFILE "__typeof__ (($type) 0) a;\n";
+	}
 	print TESTFILE "extern __typeof__ ($symbol) a;\n";
 	close (TESTFILE);
 

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]