[testsuite] Fix g++.dg/opt/devirt2.C on 32-bit Solaris/SPARC with Sun as (PR testsuite/48727)

Submitted by Rainer Orth on July 8, 2011, 10:25 a.m.

Details

Message ID ydd62nd133m.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth July 8, 2011, 10:25 a.m.
As described in the PR, unless the assembler supports -relax, SPARC gcc
can emit sethi+jmp instead of just call, so the pattern has to be more
specific.

This patch implements this, also having to account for the fact that
subexpressions in Tcl regexps double the match count.

Tested with the appropriate runtest invocation on sparc-sun-solaris2.11
with both Sun and GNU as, both multilibs, and i386-pc-solaris2.10.

Installed on mainline.

	Rainer



2011-07-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR testsuite/48727
	* g++.dg/opt/devirt2.C: Use specific pattern for sparc*-*-*.

Patch hide | download patch | download mbox

Index: gcc/testsuite/g++.dg/opt/devirt2.C
===================================================================
--- gcc/testsuite/g++.dg/opt/devirt2.C	(revision 176033)
+++ gcc/testsuite/g++.dg/opt/devirt2.C	(working copy)
@@ -2,9 +2,14 @@ 
 // { dg-options "-O2" }
 // The IA64 and HPPA compilers generate external declarations in addition
 // to the call so those scans need to be more specific.
-// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-hpux* } } } } }
-// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy"  2 { target ia64*-*-hpux* } } }
-// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r"  2 { target hppa*-*-* } } }
+// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } }
+// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy" 2 { target ia64*-*-hpux* } } }
+// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r" 2 { target hppa*-*-* } } }
+// Unless the assembler supports -relax, the 32-bit SPARC compiler generates
+// sethi/jmp instead of just call, so the scans need to be more specific.
+// With subexpressions, Tcl regexp -inline -all returns both the complete
+// match and the subexpressions, so double the count.
+// { dg-final { scan-assembler-times "\(jmp|call\)\[^\n\]*xyzzy" 4 { target sparc*-*-* } } }
 
 struct S { S(); virtual void xyzzy(); };
 struct R { int a; S s; R(); };