This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Enable dump-noaddr test to work in out of build tree testing


On 27/06/12 21:35, Andrew Pinski wrote:
On Wed, Jun 27, 2012 at 3:33 AM, Matthew Gretton-Dann
<matthew.gretton-dann@arm.com> wrote:
All,

This patch enables the dump-noaddr test to work in out-of-build-tree
testing.
[snip]

I created a much simpler patch which I have been meaning to submit. I attached it for reference.


Thanks, Andrew Pinski

ChangeLog:
* testsuite/gcc.c-torture/unsorted/dump-noaddr.x (dump_compare): Use
an absolute dump base instead of a relative one.

Index: gcc.c-torture/unsorted/dump-noaddr.x
===================================================================
--- gcc.c-torture/unsorted/dump-noaddr.x	(revision 61452)
+++ gcc.c-torture/unsorted/dump-noaddr.x	(revision 61453)
@@ -11,10 +11,10 @@ proc dump_compare { src options } {
      foreach option $option_list {
  	file delete -force dump1
  	file mkdir dump1
-	c-torture-compile $src "$option $options -dumpbase dump1/$dumpbase -DMASK=1 -x c --param ggc-min-heapsize=1 -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
+	c-torture-compile $src "$option $options -dumpbase [pwd]/dump1/$dumpbase -DMASK=1 -x c --param ggc-min-heapsize=1 -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
  	file delete -force dump2
  	file mkdir dump2
-	c-torture-compile $src "$option $options -dumpbase dump2/$dumpbase -DMASK=2 -x c -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
+	c-torture-compile $src "$option $options -dumpbase [pwd]/dump2/$dumpbase -DMASK=2 -x c -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
  	foreach dump1 [lsort [glob -nocomplain dump1/*]] {
  	    regsub dump1/ $dump1 dump2/ dump2
  	    set dumptail "gcc.c-torture/unsorted/[file tail $dump1]"

What I don't like about this approach is that dump1 and dump2 are created in the current working directory. With out of build-tree testing this may not (I believe) be the same as $tmpdir (where temporaries are normally created). Also the current directory may already contain directories/files called dump1 or dump2 which will get destroyed by running the testsuite.


Hence why my approach used tmpdir.

Does this reasoning make sense?

I've not committed my version yet in case I am missing something in my reasoning above with regards to the relationship between the current working directory and $tmpdir.

Thanks,

Matt

--
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]