Comments

There are tests in g++.tree-prof that have non-unique lines in test
summaries for scan-*-dump checks. Investigation showed that these tests
were being run multiple times, for a list of options that had leaked
over from another set of profile-directed optimization tests. This
patch doesn't fix duplicate lines for checks in profiled tests that are
run multiple times, but it does avoid the problem and, in so doing, fix
tests that use profopt.exp so they are run with the correct sets of
options.
Without this patch, tests in g++.dg/tree-prof are run with
[ { -g } { -O0 } { -O1 } { -O2 } { -O3 } { -O3 -g } { -Os } ] instead
of the expected [list {}]. Each test provides its own options, so
the ones from PROFOPT_OPTIONS were ignored.
Tests gcc.misc-tests/bprob*.c were supposed to be run with a set of
options that was instead overridden by an empty list. This patch makes
it use [ { -O2 } {-O3 } ] so the options tested there will get some
coverage with optimization, although not as much as originally planned
when the tests were added years and years ago.
The other sets of tests that use profopt.exp continue to be tested with
the same options they've been using.
OK for mainline?
Janis
2012-06-18 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.