This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
conformtest: Support specifying types before promotion
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at sourceware dot org
- Date: Sat, 28 Apr 2012 20:41:05 +0000 (UTC)
- Subject: 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