]>
Commit | Line | Data |
---|---|---|
99dee823 | 1 | # Copyright (C) 2016-2021 Free Software Foundation, Inc. |
f507d202 ML |
2 | # |
3 | # This file is part of GCC. | |
4 | # | |
5 | # GCC is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 3, or (at your option) | |
8 | # any later version. | |
9 | # | |
10 | # GCC is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with GCC; see the file COPYING3. If not see | |
17 | # <http://www.gnu.org/licenses/>. | |
18 | ||
19 | # GCC testsuite that uses the `dg.exp' driver. | |
20 | ||
21 | # Load support procs. | |
22 | load_lib gcc-dg.exp | |
23 | ||
24 | # Initialize `dg'. | |
25 | dg-init | |
26 | ||
27 | proc param_run_test { param_name param_value } { | |
28 | global srcdir | |
29 | global subdir | |
30 | ||
1182b907 | 31 | dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" "" |
f507d202 ML |
32 | } |
33 | ||
32b0081d ML |
34 | set srcfname params-[pid].c |
35 | set fd [open $srcfname w] | |
36 | puts $fd "" | |
f507d202 | 37 | close $fd |
32b0081d ML |
38 | remote_download host $srcfname |
39 | ||
40 | set gcc_options "\{additional_flags=--help=params\}" | |
41 | set text [gcc_target_compile $srcfname $srcfname.x executable $gcc_options] | |
42 | remote_file build delete $srcfname $srcfname.x | |
f507d202 ML |
43 | |
44 | # Main loop. | |
45 | foreach params [split $text "\n"] { | |
32b0081d ML |
46 | set parts [split $params " =<>,"] |
47 | if { [llength $parts] >= 8 } { | |
48 | set param [lindex $parts 2] | |
49 | set name [lindex $parts 3] | |
50 | set min [lindex $parts 5] | |
51 | set max [lindex $parts 6] | |
f507d202 | 52 | |
32b0081d | 53 | if { [ string equal $param "--param" ] && [string is integer -strict $min] && [string is integer -strict $max] } { |
f507d202 | 54 | if { $min != -1 } { |
32b0081d | 55 | param_run_test $name $min |
f507d202 | 56 | } |
32b0081d ML |
57 | if { $max != $min && $max > 0 } { |
58 | param_run_test $name $max | |
f507d202 | 59 | } |
32b0081d | 60 | } |
f507d202 ML |
61 | } |
62 | } | |
63 | ||
64 | # All done. | |
65 | dg-finish |