This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuite, lto] Solaris 8/9 x86 testsuite fixes
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Janis Johnson <janis dot marie dot johnson at gmail dot com>, Diego Novillo <dnovillo at google dot com>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Mon, 17 May 2010 21:02:28 +0200
- Subject: [testsuite, lto] Solaris 8/9 x86 testsuite fixes
During mainline testing on Solaris 11/x86 with the older Solaris 8 and 9
assemblers (in preparation for real Solaris 8/9 testing), I've
discovered a couple of testsuite problems:
* Unlike the Solaris 10 and 11 assemblers, the older ones only
understand comments starting with /, not #, but
gcc.target/i386/20011009-1.c unconditionally uses the latter. I've
changed the test to use a macro instead, conditionalized on __sun__.
* Similarly, the older assemblers require .globl, not .global, so I've
again conditionalized the directive used.
* Since Solaris 8 has no .hidden support and it's broken in Solaris 9
(cf. http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01267.html), several
LTO tests were failing since several warnings weren't properly pruned:
** The `In file include from' regex contained a : which isn't present in
the real message (and hasn't been as far back as gcc 3.4.6).
** There can also be location lines like
from :1:
** The pruning only happened for the main file, not for additional ones.
The patch below fixes all those issues and allows the LTO tests to
succeed.
Bootstrapped on i386-pc-solaris2.11 with gas 2.19, Solaris 8, 9, and 11
as.
Ok for mainline, 4.5 and 4.4 branches?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.target/i386/20011009-1.c (COMMENT): Define.
(main): Use it.
* gcc.target/i386/pr25993.c [__sun__]: Use .globl.
* lib/lto.exp (lto_prune_warns): Fix location line regex.
Prune another location line format.
(lto-obj): Call lto_prune_warns on comp_output.
diff -r e45414e86d51 gcc/testsuite/gcc.target/i386/20011009-1.c
--- a/gcc/testsuite/gcc.target/i386/20011009-1.c Mon May 17 19:09:01 2010 +0200
+++ b/gcc/testsuite/gcc.target/i386/20011009-1.c Mon May 17 19:10:26 2010 +0200
@@ -4,11 +4,17 @@
extern void abort (void);
extern void exit (int);
+#ifdef __sun__
+#define COMMENT "/"
+#else
+#define COMMENT "#"
+#endif
+
int main ()
{
int x;
- asm ("movl $26, %0 # 26 |-> reg \n\t"
+ asm ("movl $26, %0 " COMMENT " 26 |-> reg \n\t"
"movl $28, %0" : "=r" (x));
if (x != 28)
abort ();
diff -r e45414e86d51 gcc/testsuite/gcc.target/i386/pr25993.c
--- a/gcc/testsuite/gcc.target/i386/pr25993.c Mon May 17 19:09:01 2010 +0200
+++ b/gcc/testsuite/gcc.target/i386/pr25993.c Mon May 17 19:10:26 2010 +0200
@@ -5,7 +5,11 @@
#ifndef __ASSEMBLER__
extern int func(void);
#else
+#ifdef __sun__
+.globl func
+#else
.global func
+#endif
.type func,%function
.align 4
func:
diff -r e45414e86d51 gcc/testsuite/lib/lto.exp
--- a/gcc/testsuite/lib/lto.exp Mon May 17 19:09:01 2010 +0200
+++ b/gcc/testsuite/lib/lto.exp Mon May 17 19:10:26 2010 +0200
@@ -27,7 +27,8 @@
# And any stray location lines.
regsub -all "(^|\n)\[^\n\]*: In function \[^\n\]*" $text "" text
- regsub -all "(^|\n)In file included from :\[^\n\]*" $text "" text
+ regsub -all "(^|\n)In file included from \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[ \t\]*from \[^\n\]*" $text "" text
# Sun ld warns about common symbols with differing sizes. Unlike GNU ld
# --warn-common (off by default), they cannot be disabled.
@@ -137,6 +138,8 @@
set compiler_conditional_xfail_data $xfaildata
set comp_output [${tool}_target_compile "$source" "$dest" object $options]
+ # Prune unimportant visibility warnings before checking output.
+ set comp_output [lto_prune_warns $comp_output]
${tool}_check_compile "$testcase $dest assemble" $optstr $dest $comp_output
}