+2018-07-15 Tom de Vries <tdevries@suse.de>
+
+ * lib/gcc-gdb-test.exp (guality_minimal_options): New proc.
+ * lib/gfortran-dg.exp (gfortran-dg-runtest): Don't call torture-init if
+ already called.
+ * 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>
}
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;
unsetenv GUALITY_GDB_NAME
}
+torture-finish
dg-finish
}
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 \
}
report_gdb $::env(GUALITY_GDB_NAME) [info script]
+global DG_TORTURE_OPTIONS
+set guality_dg_torture_options [guality_minimal_options $DG_TORTURE_OPTIONS]
+torture-init
+set-torture-options \
+ $guality_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
}
+torture-finish
dg-finish
}
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"]
+}
# as c-torture does.
proc gfortran-dg-runtest { testcases flags default-extra-flags } {
global runtests
- global DG_TORTURE_OPTIONS torture_with_loops
-
- torture-init
- set-torture-options $DG_TORTURE_OPTIONS
+ global torture_with_loops
+
+ # Some callers set torture options themselves; don't override those.
+ set existing_torture_options [torture-options-exist]
+ if { $existing_torture_options == 0 } {
+ global DG_TORTURE_OPTIONS
+ torture-init
+ set-torture-options $DG_TORTURE_OPTIONS
+ }
+ dump-torture-options
foreach test $testcases {
# If we're only testing specific files and this isn't one of
}
}
- torture-finish
+ if { $existing_torture_options == 0 } {
+ torture-finish
+ }
}
proc gfortran-dg-debug-runtest { target_compile trivial opt_opts testcases } {