public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727
@ 2011-06-10 17:09 Steve Ellcey
  2011-06-11 17:53 ` Mike Stump
  2011-06-15 17:15 ` Hans-Peter Nilsson
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Ellcey @ 2011-06-10 17:09 UTC (permalink / raw)
  To: gcc-patches

I will check in this testsuite fix as obvious if there are no objections.
On IA64 and HPPA the test generates global declarations for the function
as well as calls so the scan-assembler-times fails because it finds the
declarations as well as the two calls.  The fix is to make the scans more
specific on IA64 and HPPA.  This fix follows the example of what was 
done in gcc.dg/tree-ssa/loop-1.c.

Steve Ellcey
sje@cup.hp.com


2011-06-10  Steve Ellcey  <sje@cup.hp.com>

	PR testsuite/48727
	* g++.dg/opt/devirt2.C: Fix scan rules for ia64*-*-* and hppa*-*-*.


Index: g++.dg/opt/devirt2.C
===================================================================
--- g++.dg/opt/devirt2.C	(revision 174878)
+++ g++.dg/opt/devirt2.C	(working copy)
@@ -1,6 +1,10 @@
 // { dg-do compile }
 // { dg-options "-O2" }
-// { dg-final { scan-assembler-times "xyzzy" 2 } }
+// 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 { xfail hppa*-*-* ia64*-*-* } } }
+// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy"  2 { target ia64*-*-* } } }
+// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r"  2 { target hppa*-*-* } } }
 
 struct S { S(); virtual void xyzzy(); };
 struct R { int a; S s; R(); };

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727
  2011-06-10 17:09 [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727 Steve Ellcey
@ 2011-06-11 17:53 ` Mike Stump
  2011-06-15 17:15 ` Hans-Peter Nilsson
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Stump @ 2011-06-11 17:53 UTC (permalink / raw)
  To: sje; +Cc: gcc-patches

On Jun 10, 2011, at 9:28 AM, Steve Ellcey wrote:
> I will check in this testsuite fix as obvious if there are no objections.

Thanks for the comments.  When doing a port, having a comment on other port's issues with a testcase, is useful, as you get to say, gosh, I'm in that class too, and just blindly follow the same path for the same reason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727
  2011-06-10 17:09 [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727 Steve Ellcey
  2011-06-11 17:53 ` Mike Stump
@ 2011-06-15 17:15 ` Hans-Peter Nilsson
  2011-06-16 20:49   ` Steve Ellcey
  1 sibling, 1 reply; 4+ messages in thread
From: Hans-Peter Nilsson @ 2011-06-15 17:15 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: gcc-patches

On Fri, 10 Jun 2011, Steve Ellcey wrote:

> I will check in this testsuite fix as obvious if there are no objections.

But... :)

> On IA64 and HPPA the test generates global declarations for the function
> as well as calls so the scan-assembler-times fails because it finds the
> declarations as well as the two calls.  The fix is to make the scans more
> specific on IA64 and HPPA.  This fix follows the example of what was
> done in gcc.dg/tree-ssa/loop-1.c.
>
> Steve Ellcey
> sje@cup.hp.com
>
>
> 2011-06-10  Steve Ellcey  <sje@cup.hp.com>
>
> 	PR testsuite/48727
> 	* g++.dg/opt/devirt2.C: Fix scan rules for ia64*-*-* and hppa*-*-*.
>
>
> Index: g++.dg/opt/devirt2.C
> ===================================================================
> --- g++.dg/opt/devirt2.C	(revision 174878)
> +++ g++.dg/opt/devirt2.C	(working copy)
> @@ -1,6 +1,10 @@
>  // { dg-do compile }
>  // { dg-options "-O2" }
> -// { dg-final { scan-assembler-times "xyzzy" 2 } }
> +// 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 { xfail hppa*-*-* ia64*-*-* } } }

JFTR, if you want this to be really right, you should not xfail
this part of the test but rather skip it, as the test is at
fault, not the targets/gcc.  If think it'd be:

// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-* } } } } }


> +// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy"  2 { target ia64*-*-* } } }
> +// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r"  2 { target hppa*-*-* } } }
>
>  struct S { S(); virtual void xyzzy(); };
>  struct R { int a; S s; R(); };
>

brgds, H-P

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727
  2011-06-15 17:15 ` Hans-Peter Nilsson
@ 2011-06-16 20:49   ` Steve Ellcey
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Ellcey @ 2011-06-16 20:49 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches

On Wed, 2011-06-15 at 12:51 -0400, Hans-Peter Nilsson wrote:
> On Fri, 10 Jun 2011, Steve Ellcey wrote:
> 
> > I will check in this testsuite fix as obvious if there are no objections.
> 
> But... :)

> JFTR, if you want this to be really right, you should not xfail
> this part of the test but rather skip it, as the test is at
> fault, not the targets/gcc.  If think it'd be:
> 
> // { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-* } } } } }
> 
> 
> > +// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy"  2 { target ia64*-*-* } } }
> > +// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r"  2 { target hppa*-*-* } } }
> >
> >  struct S { S(); virtual void xyzzy(); };
> >  struct R { int a; S s; R(); };
> >
> 
> brgds, H-P

You are right, and I am going to check in this change as obvious.
I have tested it to make sure it works.

Steve Ellcey
sje@cup.hp.com


2011-06-16  Steve Ellcey  <sje@cup.hp.com>

        PR testsuite/48727
        * g++.dg/opt/devirt2.C: Change xfail rule to target.



Index: g++.dg/opt/devirt2.C
===================================================================
--- g++.dg/opt/devirt2.C        (revision 175089)
+++ g++.dg/opt/devirt2.C        (working copy)
@@ -2,7 +2,7 @@
 // { 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 { xfail hppa*-*-* ia64*-*-hpux* } } }
+// { 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*-*-* } } }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-16 20:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-10 17:09 [patch, testsuite] Fix g++.dg/opt/devirt2.C scanning, PR 48727 Steve Ellcey
2011-06-11 17:53 ` Mike Stump
2011-06-15 17:15 ` Hans-Peter Nilsson
2011-06-16 20:49   ` Steve Ellcey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).