Commit 32b0081d by Martin Liska Committed by Martin Liska

Fix params.exp by parsing output of --help=params -Q.

2019-11-13  Martin Liska  <mliska@suse.cz>

	* gcc.dg/params/params.exp: Restore test by parsing output
	of --help=params -Q.

From-SVN: r278117
parent 9c40fd46
2019-11-13 Martin Liska <mliska@suse.cz>
* gcc.dg/params/params.exp: Restore test by parsing output
of --help=params -Q.
2019-11-13 Jiufu Guo <guojiufu@linux.ibm.com> 2019-11-13 Jiufu Guo <guojiufu@linux.ibm.com>
PR target/92465 PR target/92465
......
...@@ -31,37 +31,33 @@ proc param_run_test { param_name param_value } { ...@@ -31,37 +31,33 @@ proc param_run_test { param_name param_value } {
dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" "" dg-runtest $srcdir/$subdir/blocksort-part.c "-O3 --param $param_name=$param_value" ""
} }
set options_file "$objdir/../../params.options" set srcfname params-[pid].c
if { [info exists TESTING_IN_BUILD_TREE] == 0 } { set fd [open $srcfname w]
return puts $fd ""
}
set fd [open $options_file r]
set text [read $fd]
close $fd close $fd
remote_download host $srcfname
set gcc_options "\{additional_flags=--help=params\}"
set text [gcc_target_compile $srcfname $srcfname.x executable $gcc_options]
remote_file build delete $srcfname $srcfname.x
# Main loop. # Main loop.
foreach params [split $text "\n"] { foreach params [split $text "\n"] {
set parts [split $params "="] set parts [split $params " =<>,"]
set name [string trim [lindex $parts 0] '"'] if { [llength $parts] >= 8 } {
set values [split [lindex $parts 1] ","] set param [lindex $parts 2]
if { [llength $values] == 3 } { set name [lindex $parts 3]
set default [lindex $values 0] set min [lindex $parts 5]
set min [lindex $values 1] set max [lindex $parts 6]
set max [lindex $values 2]
set int_max "INT_MAX"
if { [ string equal $param "--param" ] && [string is integer -strict $min] && [string is integer -strict $max] } {
if { $min != -1 } { if { $min != -1 } {
param_run_test $name $min param_run_test $name $min
} }
if { $max != $min && $max > 0 && $max != $int_max } { if { $max != $min && $max > 0 } {
param_run_test $name $max param_run_test $name $max
}
}
if { [llength $values] == 5 } {
foreach v $values {
param_run_test $name $v
} }
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment