# 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
{ -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"
}
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
}
#
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
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"
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 ""
}
# 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.