Commit 873b4532 by Tom de Vries Committed by Tom de Vries

[testsuite/guality] Run guality tests with Og

We advertise Og as the optimization level of choice for the standard
edit-compile-debug cycle, but do not run the guality tests for Og with the
default torture options.

This patch ensures that we test -Og in the guality tests.

F.i., for gcc.dg/guality there are 45 fails for Og (while there are none for
O1), in these test-cases:
...
gcc.dg/guality/pr54200.c
gcc.dg/guality/pr54970.c
gcc.dg/guality/pr56154-1.c
gcc.dg/guality/pr59776.c
gcc.dg/guality/sra-1.c
...

2018-07-15  Tom de Vries  <tdevries@suse.de>

	* lib/gcc-gdb-test.exp (guality_minimal_options): New proc.
	* g++.dg/guality/guality.exp: Ensure Og is part of torture options.
	* gcc.dg/guality/guality.exp: Same.
	* gfortran.dg/guality/guality.exp: Same.

From-SVN: r262666
parent 8d93e01d
2018-07-15 Tom de Vries <tdevries@suse.de>
* lib/gcc-gdb-test.exp (guality_minimal_options): New proc.
* g++.dg/guality/guality.exp: Ensure Og is part of torture options.
* gcc.dg/guality/guality.exp: Same.
* gfortran.dg/guality/guality.exp: Same.
2018-07-13 H.J. Lu <hongjiu.lu@intel.com>
Sunil K Pandey <sunil.k.pandey@intel.com>
......
......@@ -48,6 +48,14 @@ if ![info exists ::env(GUALITY_GDB_NAME)] {
}
report_gdb $::env(GUALITY_GDB_NAME) [info script]
global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
set guality_dg_torture_options [guality_minimal_options $DG_TORTURE_OPTIONS]
torture-init
set-torture-options \
$guality_dg_torture_options \
[list {}] \
$LTO_TORTURE_OPTIONS
if {[check_guality "
#include \"$srcdir/$subdir/guality.h\"
volatile long int varl = 6;
......@@ -65,4 +73,5 @@ if [info exists guality_gdb_name] {
unsetenv GUALITY_GDB_NAME
}
torture-finish
dg-finish
......@@ -62,7 +62,8 @@ proc guality_transform_options { args } {
}
global DG_TORTURE_OPTIONS
set guality_dg_torture_options [guality_transform_options $DG_TORTURE_OPTIONS]
set guality_dg_torture_options [guality_minimal_options $DG_TORTURE_OPTIONS]
set guality_dg_torture_options [guality_transform_options $guality_dg_torture_options]
set guality_lto_torture_options [guality_transform_options $LTO_TORTURE_OPTIONS]
torture-init
set-torture-options \
......
......@@ -29,10 +29,15 @@ if ![info exists ::env(GUALITY_GDB_NAME)] {
}
report_gdb $::env(GUALITY_GDB_NAME) [info script]
global DG_TORTURE_OPTIONS
set save_dg_torture_options $DG_TORTURE_OPTIONS
set DG_TORTURE_OPTIONS [guality_minimal_options $DG_TORTURE_OPTIONS]
gfortran-dg-runtest [lsort [glob $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] "" ""
if [info exists guality_gdb_name] {
unsetenv GUALITY_GDB_NAME
}
set DG_TORTURE_OPTIONS save_dg_torture_options
dg-finish
......@@ -166,3 +166,17 @@ proc report_gdb { gdb loc } {
}
send_log -- "---\n$gdb_version\n---\n"
}
# Argument 0 is the option list.
# Return the option list, ensuring that at least -Og is present.
proc guality_minimal_options { args } {
set options [lindex $args 0]
foreach opt $options {
if { [regexp -- "-Og" $opt] } {
return $options
}
}
return [lappend options "-Og"]
}
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