OSDN Git Service

* config/i386.i386.c (ix86_return_in_memory): Reformat. Return true
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / profopt.exp
index ca62c67..4d32ff2 100644 (file)
@@ -27,7 +27,7 @@
 # addition to the profiling and feedback options.
 
 # If perf_ext is defined and the performance value for the
-# profile-directed test run is non-zero then the performance check will
+# profile-directed test run is nonzero then the performance check will
 # be done.
 
 global PROFOPT_OPTIONS perf_delta
@@ -66,15 +66,18 @@ if ![info exists PROFOPT_OPTIONS] {
        { -Os } ]
 }
 
-set option_list $PROFOPT_OPTIONS
+set prof_option_list $PROFOPT_OPTIONS
 
 #
 # profopt-cleanup -- remove profiling or performance results files.
 #
-# EXT is the extension of files to remove
+# TESTCASE is the name of the test
+# EXT is the extension of file to remove
 #
-proc profopt-cleanup { ext } {
-    set files [glob -nocomplain *.$ext]
+proc profopt-cleanup { testcase ext } {
+    set basename [file tail $testcase]
+    set base [file rootname $basename]
+    set files [glob -nocomplain $base.$ext]
     if { $files != "" } {
        eval "remote_file build delete $files"
     }
@@ -112,7 +115,7 @@ proc profopt-perf-value { testcase perf_ext optstr } {
        fail "$testcase perf check: file $base.$perf_ext has wrong format, $optstr"
     }
     close $fd
-    profopt-cleanup $perf_ext
+    profopt-cleanup $testcase $perf_ext
     return $val
 }
 
@@ -123,7 +126,7 @@ proc profopt-perf-value { testcase perf_ext optstr } {
 #
 proc profopt-execute { src } {
     global srcdir tmpdir
-    global option_list
+    global prof_option_list
     global tool profile_option feedback_option prof_ext perf_ext perf_delta
     global verbose
 
@@ -139,7 +142,7 @@ proc profopt-execute { src } {
     set executable $tmpdir/[file tail [file rootname $src].x]
 
     set count 0
-    foreach option $option_list {
+    foreach option $prof_option_list {
        set execname1 "${executable}${count}1"
        set execname2 "${executable}${count}2"
        set execname3 "${executable}${count}3"
@@ -150,6 +153,12 @@ proc profopt-execute { src } {
        remote_file build delete $execname3
        verbose "Testing $testcase, $option" 1
 
+       # Remove old profiling and performance data files.
+       profopt-cleanup $testcase $prof_ext
+       if [info exists perf_ext] {
+           profopt-cleanup $testcase $perf_ext
+       }
+
        # Compile for profiling.
 
        set options ""
@@ -210,7 +219,7 @@ proc profopt-execute { src } {
        }
 
        # Remove the profiling data files.
-       profopt-cleanup $prof_ext
+       profopt-cleanup $testcase $prof_ext
 
        # If the test is not expected to produce performance data then
        # we're done now.