]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/params/params.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / params / params.exp
CommitLineData
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.
22load_lib gcc-dg.exp
23
24# Initialize `dg'.
25dg-init
26
27proc 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
34set srcfname params-[pid].c
35set fd [open $srcfname w]
36puts $fd ""
f507d202 37close $fd
32b0081d
ML
38remote_download host $srcfname
39
40set gcc_options "\{additional_flags=--help=params\}"
41set text [gcc_target_compile $srcfname $srcfname.x executable $gcc_options]
42remote_file build delete $srcfname $srcfname.x
f507d202
ML
43
44# Main loop.
45foreach 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.
65dg-finish