public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pph] Remove XPASS noise from pph testsuite (issue4967063)
@ 2011-09-12 12:07 Diego Novillo
  2011-09-12 15:18 ` Gabriel Charette
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Novillo @ 2011-09-12 12:07 UTC (permalink / raw)
  To: reply, crowl, gcc-patches

This patch removes all the XPASS noise from pph.exp runs by pruning
the output from the base compiles (thanks Ian for the pointer).  It
add some comments as well.

Lawrence, I noticed that we do not seem to need -I. -fno-dwarf2-cfi-asm 
anymore.  So, I removed them.  I'm not sure I remember exactly why you
had added them, but since removing them produces no changes to the
results, I just took them out.

No need for filtering out results anymore; make check should produce
no extraneous XPASS output anymore.

Tested on x86_64.  Committed to branch.


Diego.

	* lib/dg-pph.exp (dg-pph-pos): Do not compile base cases with
	dg-test.  Use g++-dg-test and g++-dg-prune to build base cases.

diff --git a/gcc/testsuite/lib/dg-pph.exp b/gcc/testsuite/lib/dg-pph.exp
index 08c01da..3573fba 100644
--- a/gcc/testsuite/lib/dg-pph.exp
+++ b/gcc/testsuite/lib/dg-pph.exp
@@ -19,6 +19,7 @@
 
 load_lib copy-file.exp
 
+# Generate a PPH image from a header file.
 proc dg-pph-hdr { subdir test options mapflag suffix } {
 
     global runtests dg-do-what-default
@@ -40,6 +41,8 @@ proc dg-pph-hdr { subdir test options mapflag suffix } {
     }
 }
 
+# Run a negative PPH test.  These tests are expected to produce an error
+# as they represent files that are not compatible with PPH.
 proc dg-pph-neg { subdir test options mapflag suffix } {
 
     global runtests dg-do-what-default
@@ -61,6 +64,11 @@ proc dg-pph-neg { subdir test options mapflag suffix } {
     }
 }
 
+# Run a positive PPH test (a test expected to work with PPH).  Tests not
+# marked 'dg-do run' or 'dg-do link' are compiled twice.  The first time
+# with PPH disabled, the second time with PPH enabled.  The assembly
+# output from both compiles is then compared.  The test succeeds if both
+# assembly outputs are identical.
 proc dg-pph-pos { subdir test options mapflag suffix } {
 
     global runtests dg-do-what-default
@@ -70,14 +78,11 @@ proc dg-pph-pos { subdir test options mapflag suffix } {
 	return
     }
 
+    set dg-do-what-default compile
     set nshort "$subdir/[file tail $test]"
     set bname "[file rootname [file tail $nshort]]"
     verbose -log "\nTesting $nshort, $options"
 
-    # Compile the file the first time for a base case.
-    set dg-do-what-default compile
-    dg-test -keep-output $test "$options -I. -fno-dwarf2-cfi-asm" ""
-
     # Determine whether this is an assembly comparison test
     set is_exec [llength [grep $test "dg-do run"]]
     set is_link [llength [grep $test "dg-do link"]]
@@ -88,11 +93,31 @@ proc dg-pph-pos { subdir test options mapflag suffix } {
     }
 
     if { $is_asm } {
+	# Compile the file the first time for a base case.
+	global target_triplet
+
+	# First, gather additional options specified by the test.
+	set all_dg_options [dg-get-options $test]
+	set other_options ""
+	foreach dg_option $all_dg_options {
+	    set cmd [lindex $dg_option 0]
+	    if { [string match "dg-options" $cmd] } {
+		set other_options "$other_options [lindex $dg_option 2]"
+	    }
+	}
+
+	# Now, compile the file but prune the result to avoid considering
+	# it part of the testsuite.  We just want to compile it to provide
+	# a base assembly output to compare against.
+	set comp_output [g++-dg-test $test compile "$options $other_options"]
+	set comp_output [g++-dg-prune $target_triplet $comp_output]
+
 	# Wanted assembly, so quit if it did not compile successfully.
 	if { ![file_on_host exists "$bname.s"] } {
 	    fail "$nshort $options (regular assembly missing)"
 	    return
 	}
+
 	# Rename the .s file into .s-pph to compare it after the second build.
 	remote_upload host "$bname.s" "$bname.s-pph"
 	remote_download host "$bname.s-pph"
@@ -101,8 +126,8 @@ proc dg-pph-pos { subdir test options mapflag suffix } {
 
     verbose -log ""
 
-    # Compile a second time using the pph files.
-    dg-test -keep-output $test "$options $mapflag -I. -fno-dwarf2-cfi-asm" ""
+    # Compile a second time using the PPH files.
+    dg-test -keep-output $test "$options $mapflag" ""
 
     if { !$is_asm } {
 	# No assembly means we cannot compare them,
@@ -131,6 +156,7 @@ proc dg-pph-pos { subdir test options mapflag suffix } {
     # In most tests, they should be identical.
     # Tests involving overload injection and such will have different assembly.
     set adiff [catch {exec diff "$bname.s-pph" "$bname.s+pph"} diff_result]
+
     # The sources mark when they expect the comparison to differ.
     # When marked with xdiff, the difference is a problem.
     # When marked with xwant, the difference is what we want.

--
This patch is available for review at http://codereview.appspot.com/4967063

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

* Re: [pph] Remove XPASS noise from pph testsuite (issue4967063)
  2011-09-12 12:07 [pph] Remove XPASS noise from pph testsuite (issue4967063) Diego Novillo
@ 2011-09-12 15:18 ` Gabriel Charette
  2011-09-12 22:50   ` Lawrence Crowl
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Charette @ 2011-09-12 15:18 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, crowl, gcc-patches

Oops forgot to reply all...

On Mon, Sep 12, 2011 at 7:40 AM, Diego Novillo <dnovillo@google.com> wrote:
> This patch removes all the XPASS noise from pph.exp runs by pruning
> the output from the base compiles (thanks Ian for the pointer).  It
> add some comments as well.
>
> Lawrence, I noticed that we do not seem to need -I. -fno-dwarf2-cfi-asm
> anymore.  So, I removed them.  I'm not sure I remember exactly why you
> had added them, but since removing them produces no changes to the
> results, I just took them out.

This was a hack because Lawrence was getting different asm checksums
for the pph asm xdiff because his configuration would output some
additional dwarf2-cfi assembly. Thus, no single expected diff checksum
would work for both of us.

Cheers,
Gab

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

* Re: [pph] Remove XPASS noise from pph testsuite (issue4967063)
  2011-09-12 15:18 ` Gabriel Charette
@ 2011-09-12 22:50   ` Lawrence Crowl
  0 siblings, 0 replies; 3+ messages in thread
From: Lawrence Crowl @ 2011-09-12 22:50 UTC (permalink / raw)
  To: Gabriel Charette; +Cc: Diego Novillo, reply, gcc-patches

And I have confirmed the problem is still here.  I'll be reinserting
the option.

On 9/12/11, Gabriel Charette <gcharette1@gmail.com> wrote:
> Oops forgot to reply all...
>
> On Mon, Sep 12, 2011 at 7:40 AM, Diego Novillo <dnovillo@google.com> wrote:
>> This patch removes all the XPASS noise from pph.exp runs by pruning
>> the output from the base compiles (thanks Ian for the pointer).  It
>> add some comments as well.
>>
>> Lawrence, I noticed that we do not seem to need -I. -fno-dwarf2-cfi-asm
>> anymore.  So, I removed them.  I'm not sure I remember exactly why you
>> had added them, but since removing them produces no changes to the
>> results, I just took them out.
>
> This was a hack because Lawrence was getting different asm checksums
> for the pph asm xdiff because his configuration would output some
> additional dwarf2-cfi assembly. Thus, no single expected diff checksum
> would work for both of us.
>
> Cheers,
> Gab
>


-- 
Lawrence Crowl

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

end of thread, other threads:[~2011-09-12 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-12 12:07 [pph] Remove XPASS noise from pph testsuite (issue4967063) Diego Novillo
2011-09-12 15:18 ` Gabriel Charette
2011-09-12 22:50   ` Lawrence Crowl

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).