summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/lib
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-11-18 19:36:21 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-11-18 19:36:21 +0000
commita504aabfa69478577525504a066c5bfdf32854e3 (patch)
tree5ac637c78ec3263b30ed48d6bbb0cd024a42f226 /gcc/testsuite/lib
parent08accd20566ec883ff03b7d7c7c991c562787bbf (diff)
downloadppe42-gcc-a504aabfa69478577525504a066c5bfdf32854e3.tar.gz
ppe42-gcc-a504aabfa69478577525504a066c5bfdf32854e3.zip
Various changes from devo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r--gcc/testsuite/lib/c-torture.exp63
-rw-r--r--gcc/testsuite/lib/old-dejagnu.exp7
2 files changed, 53 insertions, 17 deletions
diff --git a/gcc/testsuite/lib/c-torture.exp b/gcc/testsuite/lib/c-torture.exp
index 76732eceeea..3e77d6c419e 100644
--- a/gcc/testsuite/lib/c-torture.exp
+++ b/gcc/testsuite/lib/c-torture.exp
@@ -23,12 +23,16 @@
# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
if ![info exists TORTURE_OPTIONS] {
- # FIXME: We should test -g at least once.
+ # It is theoretically beneficial to group all of the O2 options together,
+ # as in many cases the compiler will generate identical executables for
+ # all of them--and the c-torture testsuite will skip testing identical
+ # executables multiple times.
set TORTURE_OPTIONS [list \
{ -O0 } { -O1 } { -O2 } \
{ -O2 -fomit-frame-pointer -finline-functions } \
{ -O2 -fomit-frame-pointer -finline-functions -funroll-loops } \
- { -O2 -fomit-frame-pointer -finline-functions -funroll-all-loops }]
+ { -O2 -fomit-frame-pointer -finline-functions -funroll-all-loops } \
+ { -O2 -g } ]
}
@@ -130,9 +134,14 @@ proc c-torture-compile { src option } {
# run the compile.exp tests for example - one need only pass compile.exp to
# dejagnu, and not compile.exp, foo1.exp, foo2.exp, etc.).
#
-proc c-torture-execute { src } {
+proc c-torture-execute { src args } {
global tmpdir tool srcdir output
+ if { [llength $args] > 0 } {
+ set additional_flags [lindex $args 0];
+ } else {
+ set additional_flags "";
+ }
# Check for alternate driver.
if [file exists [file rootname $src].cexp] {
verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
@@ -163,31 +172,42 @@ proc c-torture-execute { src } {
set testcase "[file tail [file dirname $src]]/[file tail $src]"
}
+ set count 0;
+ set oldstatus "foo";
foreach option $option_list {
+ if { $count > 0 } {
+ set oldexec $execname;
+ }
+ set execname "${executable}${count}";
+ incr count;
+
# torture_{compile,execute}_xfail are set by the .cexp script
# (if present)
if [info exists torture_compile_xfail] {
setup_xfail $torture_compile_xfail
}
- remote_file build delete $executable
+ remote_file build delete $execname;
verbose "Testing $testcase, $option" 1
set options ""
lappend options "additional_flags=-w $option"
- set comp_output [gcc_target_compile "$src" "$executable" executable $options];
+ if { $additional_flags != "" } {
+ lappend options "additional_flags=$additional_flags";
+ }
+ set comp_output [gcc_target_compile "$src" "${execname}" executable $options];
# Set a few common compiler messages.
set fatal_signal "*cc: Internal compiler error: program*got fatal signal"
if [string match "$fatal_signal 6" $comp_output] then {
gcc_fail $testcase "Got Signal 6, $option"
- remote_file build delete $executable
+ remote_file build delete $execname
continue
}
if [string match "$fatal_signal 11" $comp_output] then {
gcc_fail $testcase "Got Signal 11, $option"
- remote_file build delete $executable
+ remote_file build delete $execname
continue
}
@@ -196,7 +216,7 @@ proc c-torture-execute { src } {
warning "$testcase: (with warnings) $option"
send_log "$comp_output\n"
unresolved "$testcase, $option"
- remote_file build delete $executable
+ remote_file build delete $execname
continue
}
@@ -207,7 +227,7 @@ proc c-torture-execute { src } {
if { $unsupported_message != "" } {
unsupported "$testcase: $unsupported_message"
continue
- } elseif ![file exists $executable] {
+ } elseif ![file exists $execname] {
if ![is3way] {
fail "$testcase compilation, $option"
untested "$testcase execution, $option"
@@ -234,14 +254,27 @@ proc c-torture-execute { src } {
if [info exists torture_execute_xfail] {
setup_xfail $torture_execute_xfail
}
-
- set result [gcc_load "$executable" "" ""]
- set status [lindex $result 0];
- set output [lindex $result 1];
- if { $status == "pass" } {
- remote_file build delete $executable
+ set skip 0;
+ if [info exists oldexec] {
+ if { [remote_file build cmp $oldexec $execname] == 0 } {
+ set skip 1;
+ }
+ }
+ if { $skip == 0 } {
+ set result [gcc_load "$execname" "" ""]
+ set status [lindex $result 0];
+ set output [lindex $result 1];
+ }
+ if { $oldstatus == "pass" } {
+ remote_file build delete $oldexec;
}
$status "$testcase execution, $option"
+ set oldstatus $status;
+ }
+ if [info exists status] {
+ if { $status == "pass" } {
+ remote_file build delete $execname;
+ }
}
}
diff --git a/gcc/testsuite/lib/old-dejagnu.exp b/gcc/testsuite/lib/old-dejagnu.exp
index cd7f46b4f17..02f84a46cb9 100644
--- a/gcc/testsuite/lib/old-dejagnu.exp
+++ b/gcc/testsuite/lib/old-dejagnu.exp
@@ -230,7 +230,8 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
lappend cflags "compiler=$compiler"
- set output "$tmpdir/a.out"
+ regsub -all "\[./\]" "$name" "-" output;
+ set output "$tmpdir/$output";
set compile_type "executable"
set tmp [lindex [grep $prog "Build don.t link:"] 0]
@@ -522,7 +523,9 @@ proc old-dejagnu { compiler prog cflagsx default_cflags libs } {
set result [eval [format "%s_load %s" $tool $executable]]
set status [lindex $result 0];
set output [lindex $result 1];
- remote_file build delete $executable;
+ if { $status == "pass" } {
+ remote_file build delete $executable;
+ }
if { $execbug_flag || $excessbug_flag } then {
setup_xfail "*-*-*"
}
OpenPOWER on IntegriCloud