Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/params/params.exp @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 # Copyright (C) 2016-2018 Free Software Foundation, Inc. | 1 # Copyright (C) 2016-2020 Free Software Foundation, Inc. |
2 # | 2 # |
3 # This file is part of GCC. | 3 # This file is part of GCC. |
4 # | 4 # |
5 # GCC is free software; you can redistribute it and/or modify | 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 | 6 # it under the terms of the GNU General Public License as published by |
29 global subdir | 29 global subdir |
30 | 30 |
31 dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" "" | 31 dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" "" |
32 } | 32 } |
33 | 33 |
34 set options_file "$objdir/../../params.options" | 34 set srcfname params-[pid].c |
35 if { [info exists TESTING_IN_BUILD_TREE] == 0 } { | 35 set fd [open $srcfname w] |
36 return | 36 puts $fd "" |
37 } | 37 close $fd |
38 remote_download host $srcfname | |
38 | 39 |
39 set fd [open $options_file r] | 40 set gcc_options "\{additional_flags=--help=params\}" |
40 set text [read $fd] | 41 set text [gcc_target_compile $srcfname $srcfname.x executable $gcc_options] |
41 close $fd | 42 remote_file build delete $srcfname $srcfname.x |
42 | 43 |
43 # Main loop. | 44 # Main loop. |
44 foreach params [split $text "\n"] { | 45 foreach params [split $text "\n"] { |
45 set parts [split $params "="] | 46 set parts [split $params " =<>,"] |
46 set name [string trim [lindex $parts 0] '"'] | 47 if { [llength $parts] >= 8 } { |
47 set values [split [lindex $parts 1] ","] | 48 set param [lindex $parts 2] |
48 if { [llength $values] == 3 } { | 49 set name [lindex $parts 3] |
49 set default [lindex $values 0] | 50 set min [lindex $parts 5] |
50 set min [lindex $values 1] | 51 set max [lindex $parts 6] |
51 set max [lindex $values 2] | |
52 set int_max "INT_MAX" | |
53 | 52 |
53 if { [ string equal $param "--param" ] && [string is integer -strict $min] && [string is integer -strict $max] } { | |
54 if { $min != -1 } { | 54 if { $min != -1 } { |
55 param_run_test $name $min | 55 param_run_test $name $min |
56 } | 56 } |
57 if { $max != $min && $max > 0 && $max != $int_max } { | 57 if { $max != $min && $max > 0 } { |
58 param_run_test $name $max | 58 param_run_test $name $max |
59 } | 59 } |
60 } | 60 } |
61 if { [llength $values] == 5 } { | |
62 foreach v $values { | |
63 param_run_test $name $v | |
64 } | |
65 } | 61 } |
66 } | 62 } |
67 | 63 |
68 # All done. | 64 # All done. |
69 dg-finish | 65 dg-finish |