PCH test infrastructure compiles each test twice, with identical results in the test summary file (assuming they both pass or both fail). This patch adds an extra flag to each compile, "-Dcompile1" or "-Dcompile2", to make the summary lines unique. This is a rather lame fix but at least I added a comment.
Tested on i686-pc-linux-gnu and arm-none-eabi. OK for mainline? Janis
2012-06-13 Janis Johnson <jani...@codesourcery.com> * lib/dg-pch.exp (dg-flags-pch): Add flags to make compile lines in test summary unique. Index: lib/dg-pch.exp =================================================================== --- lib/dg-pch.exp (revision 188482) +++ lib/dg-pch.exp (working copy) @@ -50,14 +50,16 @@ # Ensure that the PCH file is used, not the original header. file_on_host delete "$bname$suffix" - dg-test -keep-output $test "$otherflags $flags -I." "" + # The flags "-Dcompile1" and "-Dcompile2" are to distinguish the + # two compiles in test summary lines. + dg-test -keep-output $test "$otherflags $flags -I. -Dcompile1" "" file_on_host delete "$bname$suffix.gch" if { !$have_errs } { if { [ file_on_host exists "$bname.s" ] } { remote_upload host "$bname.s" "$bname.s-gch" remote_download host "$bname.s-gch" gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix" - dg-test -keep-output $test "$otherflags $flags -I." "" + dg-test -keep-output $test "$otherflags $flags -I. -Dcompile2" "" remote_upload host "$bname.s" set tmp [ diff "$bname.s" "$bname.s-gch" ] if { $tmp == 0 } { @@ -89,4 +91,4 @@ proc dg-pch { subdir test options suffix } { return [dg-flags-pch $subdir $test "" $options $suffix] -} \ No newline at end of file +}