diff options
author | Janis Johnson <janisjo@codesourcery.com> | 2012-06-25 22:01:34 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2012-06-25 22:01:34 +0000 |
commit | ce15c7d5ab96de22d56c05c827e2ab98624155c1 (patch) | |
tree | 1a1736c634dcac65c5584ae5502f3e5b015d2569 /gcc | |
parent | ef25bad4976e7d489e35af430c0839761b6abcad (diff) | |
download | gcc-ce15c7d5ab96de22d56c05c827e2ab98624155c1.zip gcc-ce15c7d5ab96de22d56c05c827e2ab98624155c1.tar.gz gcc-ce15c7d5ab96de22d56c05c827e2ab98624155c1.tar.bz2 |
profopt.exp: Make prof_option_list local to profopt-execute.
* lib/profopt.exp: Make prof_option_list local to profopt-execute.
* g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after
including profopt.opt; save and restore existing value.
* g++.dg/bprob/bprob.exp: Likewise.
* gcc.dg/matrix/matrix.exp: Likewise.
* gcc.dg/tree-prof/tree-prof.exp: Likewise.
* gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored
PROFOPT_OPTIONS.
From-SVN: r188964
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/bprob/bprob.exp | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-prof/tree-prof.exp | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/matrix/matrix.exp | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.misc-tests/bprob.exp | 16 | ||||
-rw-r--r-- | gcc/testsuite/lib/profopt.exp | 10 |
7 files changed, 48 insertions, 26 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8fec8b2..a8416dc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2012-06-25 Janis Johnson <janisjo@codesourcery.com> + + * lib/profopt.exp: Make prof_option_list local to profopt-execute. + * g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after + including profopt.opt; save and restore existing value. + * g++.dg/bprob/bprob.exp: Likewise. + * gcc.dg/matrix/matrix.exp: Likewise. + * gcc.dg/tree-prof/tree-prof.exp: Likewise. + * gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored + PROFOPT_OPTIONS. + 2012-06-25 Richard Henderson <rth@redhat.com> * gcc.dg/pr53749.c: New. diff --git a/gcc/testsuite/g++.dg/bprob/bprob.exp b/gcc/testsuite/g++.dg/bprob/bprob.exp index 3f75a2e..bb0d464 100644 --- a/gcc/testsuite/g++.dg/bprob/bprob.exp +++ b/gcc/testsuite/g++.dg/bprob/bprob.exp @@ -33,7 +33,11 @@ if $tracelevel then { strace $tracelevel } -# Override the list defined in profopt.exp. +# Load support procs. +load_lib profopt.exp + +# Save and override the default list defined in profopt.exp. +set bprob_save_profopt_options $PROFOPT_OPTIONS set PROFOPT_OPTIONS [list \ { -g } \ { -O0 } \ @@ -47,9 +51,6 @@ if $tracelevel then { strace $tracelevel } -# Load support procs. -load_lib profopt.exp - set profile_options "-fprofile-arcs" set feedback_options "-fbranch-probabilities" @@ -63,3 +64,5 @@ foreach profile_option $profile_options feedback_option $feedback_options { profopt-execute $src } } + +set PROFOPT_OPTIONS $bprob_save_profopt_options diff --git a/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp b/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp index 0f69a16..b4aa22d 100644 --- a/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp +++ b/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp @@ -29,9 +29,6 @@ if { ![check_profiling_available "-fprofile-generate"] } { set tool g++ set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ if $tracelevel then { # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.C]] { } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options diff --git a/gcc/testsuite/gcc.dg/matrix/matrix.exp b/gcc/testsuite/gcc.dg/matrix/matrix.exp index c1bf271..d2e1344 100644 --- a/gcc/testsuite/gcc.dg/matrix/matrix.exp +++ b/gcc/testsuite/gcc.dg/matrix/matrix.exp @@ -39,9 +39,6 @@ if { ![check_profiling_available "-fprofile-generate"] } { set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -49,6 +46,10 @@ if $tracelevel then { # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set matrix_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -63,3 +64,4 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/transpose-*.c]] { profopt-execute $src } +set PROFOPT_OPTIONS $matrix_save_profopt_options diff --git a/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp b/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp index 2d054d2..e3c5e3d 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp +++ b/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp @@ -29,9 +29,6 @@ if { ![check_profiling_available "-fprofile-generate"] } { set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ if $tracelevel then { # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options diff --git a/gcc/testsuite/gcc.misc-tests/bprob.exp b/gcc/testsuite/gcc.misc-tests/bprob.exp index e579b36..6f520ec 100644 --- a/gcc/testsuite/gcc.misc-tests/bprob.exp +++ b/gcc/testsuite/gcc.misc-tests/bprob.exp @@ -30,16 +30,6 @@ set tool gcc set prof_ext "gcda" set perf_ext tim -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list \ - { -g } \ - { -O0 } \ - { -O1 } \ - { -O2 -DPERFTIME } \ - { -O3 -DPERFTIME } \ - { -O3 -g -DPERFTIME } \ - { -Os } ] - if $tracelevel then { strace $tracelevel } @@ -47,6 +37,10 @@ if $tracelevel then { # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set bprob_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list { -O2 } { -O3 }] + set profile_options "-fprofile-arcs" set feedback_options "-fbranch-probabilities" @@ -59,3 +53,5 @@ foreach profile_option $profile_options feedback_option $feedback_options { profopt-execute $src } } + +set PROFOPT_OPTIONS $bprob_save_profopt_options diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index 5e0f9a2..f0dbee7 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -64,8 +64,6 @@ if ![info exists PROFOPT_OPTIONS] { { -Os } ] } -set prof_option_list $PROFOPT_OPTIONS - # # profopt-cleanup -- remove profiling or performance results files. # @@ -215,7 +213,7 @@ proc profopt-get-options { src } { # proc profopt-execute { src } { global srcdir tmpdir - global prof_option_list + global PROFOPT_OPTIONS global tool profile_option feedback_option prof_ext perf_ext perf_delta global generate_final_code use_final_code global verbose @@ -227,6 +225,12 @@ proc profopt-execute { src } { error "No feedback option specified for second compile." } + # Use the default option list or one defined for a set of tests. + if ![info exists PROFOPT_OPTIONS] { + error "PROFOPT_OPTIONS is not defined" + } + set prof_option_list $PROFOPT_OPTIONS + regsub "(?q)$srcdir/" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip |