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

login
register
mail settings
Submitter Matthew Gretton-Dann
Date June 27, 2012, 10:33 a.m.
Message ID <4FEAE18B.5030105@arm.com>
Download mbox | patch
Permalink /patch/167602/
State New
Headers show

Comments

Matthew Gretton-Dann - June 27, 2012, 10:33 a.m.
All,

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

It does this by making sure that the dump files generated during the
test are created under $tmpdir.

gcc/testsuite/ChangeLog:
2012-06-27  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>

	* gcc.c-torture/unsorted/dump-noaddr.x: Generate dump files in
	tmpdir.

Tested both in and out of build-tree against an arm-none-eabi targetted 
compiler.

OK?

Thanks,

Matt
Mike Stump - June 27, 2012, 6:25 p.m.
On Jun 27, 2012, at 3:33 AM, Matthew Gretton-Dann wrote:
> This patch enables the dump-noaddr test to work in out-of-build-tree testing.

> 	* gcc.c-torture/unsorted/dump-noaddr.x: Generate dump files in
> 	tmpdir.

> OK?

Ok.

Patch

diff --git a/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x b/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x
index a8174e0..bd84c06 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x
+++ b/gcc/testsuite/gcc.c-torture/unsorted/dump-noaddr.x
@@ -9,14 +9,14 @@  proc dump_compare { src options } {
 
     # loop through all the 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"
-	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"
-	foreach dump1 [lsort [glob -nocomplain dump1/*]] {
-	    regsub dump1/ $dump1 dump2/ dump2
+	file delete -force $tmpdir/dump1
+	file mkdir $tmpdir/dump1
+	c-torture-compile $src "$option $options -dumpbase $tmpdir/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 $tmpdir/dump2
+	file mkdir $tmpdir/dump2
+	c-torture-compile $src "$option $options -dumpbase $tmpdir/dump2/$dumpbase -DMASK=2 -x c -fdump-ipa-all -fdump-rtl-all -fdump-tree-all -fdump-noaddr"
+	foreach dump1 [lsort [glob -nocomplain $tmpdir/dump1/*]] {
+	    set dump2 "$tmpdir/dump2/[file tail $dump1]"
 	    set dumptail "gcc.c-torture/unsorted/[file tail $dump1]"
 	    #puts "$option $dump1"
 	    set tmp [ diff "$dump1" "$dump2" ]
@@ -30,8 +30,8 @@  proc dump_compare { src options } {
 	    #exec diff $dump1 $dump2
 	}
     }
-    file delete -force dump1
-    file delete -force dump2
+    file delete -force $tmpdir/dump1
+    file delete -force $tmpdir/dump2
 }
 
 catch {dump_compare $src $options} result