]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.misc-tests/bprob.exp
Update Copyright years for files modified in 2011 and/or 2012.
[thirdparty/gcc.git] / gcc / testsuite / gcc.misc-tests / bprob.exp
CommitLineData
71e45bc2 1# Copyright (C) 2001, 2002, 2004, 2007, 2008, 2011, 2012
2# Free Software Foundation, Inc.
4df75d5e 3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
f63ff66b 6# the Free Software Foundation; either version 3 of the License, or
4df75d5e 7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
f63ff66b 15# along with GCC; see the file COPYING3. If not see
16# <http://www.gnu.org/licenses/>.
4df75d5e 17
18# Test the functionality of programs compiled with profile-directed block
19# ordering using -fprofile-arcs followed by -fbranch-probabilities.
20
9a82df26 21load_lib target-supports.exp
22
df40bb17 23# Some targets don't have any implementation of __bb_init_func or are
24# missing other needed machinery.
9bd65cc1 25if { ![check_profiling_available "-fprofile-arcs"] } {
df40bb17 26 return
27}
28
4df75d5e 29# The procedures in profopt.exp need these parameters.
30set tool gcc
3e3a0e9c 31set prof_ext "gcda"
4df75d5e 32set perf_ext tim
33
4df75d5e 34if $tracelevel then {
35 strace $tracelevel
36}
37
38# Load support procs.
39load_lib profopt.exp
40
5d1859c8 41# Save and override the default list defined in profopt.exp.
42set bprob_save_profopt_options $PROFOPT_OPTIONS
43set PROFOPT_OPTIONS [list { -O2 } { -O3 }]
44
6ab3444b 45set profile_options "-fprofile-arcs"
a30bbccf 46set feedback_options "-fbranch-probabilities"
4df75d5e 47
6ab3444b 48foreach profile_option $profile_options feedback_option $feedback_options {
49 foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {
50 # If we're only testing specific files and this isn't one of them, skip it.
51 if ![runtest_file_p $runtests $src] then {
52 continue
53 }
54 profopt-execute $src
55 }
4df75d5e 56}
5d1859c8 57
58set PROFOPT_OPTIONS $bprob_save_profopt_options