Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / params / params.exp
blob0499a1c1ddd501f218f4160abcb8243f77764a95
1 # Copyright (C) 2016-2017 Free Software Foundation, Inc.
3 # This file is part of GCC.
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.
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.
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/>.
19 # GCC testsuite that uses the `dg.exp' driver.
21 # Load support procs.
22 load_lib gcc-dg.exp
24 # Initialize `dg'.
25 dg-init
27 proc param_run_test { param_name param_value } {
28 global srcdir
29 global subdir
31 dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" ""
34 set options_file "$objdir/../../params.options"
35 if { [info exists TESTING_IN_BUILD_TREE] == 0 } {
36 return
39 set fd [open $options_file r]
40 set text [read $fd]
41 close $fd
43 # Main loop.
44 foreach params [split $text "\n"] {
45 set parts [split $params "="]
46 set name [string trim [lindex $parts 0] '"']
47 set values [split [lindex $parts 1] ","]
48 if { [llength $values] == 3 } {
49 set default [lindex $values 0]
50 set min [lindex $values 1]
51 set max [lindex $values 2]
52 set int_max "INT_MAX"
54 if { $min != -1 } {
55 param_run_test $name $min
57 if { $max != $min && $max > 0 && $max != $int_max } {
58 param_run_test $name $max
61 if { [llength $values] == 5 } {
62 foreach v $values {
63 param_run_test $name $v
68 # All done.
69 dg-finish