]>
Commit | Line | Data |
---|---|---|
23a5b65a | 1 | # Copyright (C) 2008-2014 Free Software Foundation, Inc. |
3b2488ca L |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with GCC; see the file COPYING3. If not see | |
15 | # <http://www.gnu.org/licenses/>. | |
16 | ||
17 | # This harness is for tests that should be run at all optimisation levels. | |
18 | ||
19 | load_lib g++-dg.exp | |
165b955b JJ |
20 | load_lib torture-options.exp |
21 | ||
22 | global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS | |
23 | ||
cc825d98 | 24 | dg-init |
165b955b JJ |
25 | torture-init |
26 | ||
27 | # default_flags are replaced by a dg-options test directive, or appended | |
28 | # to by using dg-additional-options. Use default_flags for options that | |
29 | # are used in all of the torture sets to limit the amount of noise in | |
30 | # test summaries. | |
31 | set default_flags "" | |
32 | ||
33 | # torture_flags are combined with other torture options and do not | |
34 | # affect options specified within a test. | |
35 | set torture_flags "" | |
36 | ||
37 | set stackalign_options [list] | |
cc825d98 RH |
38 | |
39 | # If automatic stack alignment is supported, force it on. | |
40 | if { [check_effective_target_automatic_stack_alignment] } then { | |
165b955b JJ |
41 | append default_flags " -mstackrealign" |
42 | append default_flags " -mpreferred-stack-boundary=5" | |
3b2488ca | 43 | } |
165b955b | 44 | lappend stackalign_options [join $torture_flags] |
3b2488ca | 45 | |
3b2488ca | 46 | if { [check_effective_target_fpic] } then { |
165b955b JJ |
47 | lappend torture_flags "-fpic" |
48 | lappend stackalign_options [join $torture_flags] | |
3b2488ca | 49 | } |
165b955b JJ |
50 | |
51 | # Combine stackalign options with the usual torture optimization flags. | |
52 | set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS] $stackalign_options | |
53 | ||
a03bd005 | 54 | gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" "$default_flags" |
165b955b JJ |
55 | |
56 | torture-finish | |
3b2488ca | 57 | dg-finish |