From 15ec0729351b354a05bb6a0ac9a2f4da593efb62 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 18 Nov 1997 12:36:21 -0700 Subject: [PATCH] Various changes from devo. From-SVN: r16568 --- gcc/testsuite/ChangeLog | 42 +++++++++++-- .../g++.old-deja/g++.brendan/asm-extn1.C | 2 +- gcc/testsuite/g++.old-deja/g++.mike/eh1.C | 3 +- gcc/testsuite/g++.old-deja/g++.mike/eh10.C | 2 +- gcc/testsuite/g++.old-deja/g++.mike/p7325.C | 1 + gcc/testsuite/gcc.c-torture/ChangeLog | 20 +++++- .../gcc.c-torture/execute/conversion.c | 16 +++++ .../gcc.c-torture/execute/ieee/ieee.exp | 10 ++- gcc/testsuite/lib/c-torture.exp | 63 ++++++++++++++----- gcc/testsuite/lib/old-dejagnu.exp | 7 ++- 10 files changed, 137 insertions(+), 29 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2003c03429..55df5aea1f4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,12 +1,34 @@ -Mon Oct 6 12:03:10 1997 Jeffrey A Law (law@cygnus.com) +Fri Sep 26 10:50:53 1997 Bob Manson - * lib/g77.exp, lib/f-torture.exp: New files. + * lib/c-torture.exp(c-torture-execute): Fix typo. + + * lib/old-dejagnu.exp(old-dejagnu): Use a name derived from the + testcase as the executable name. Keep the executable around if + the test fails. + +Fri Sep 19 17:19:53 1997 Bob Manson + + * lib/c-torture.exp (TORTURE_OPTIONS): Removed unnecessary + changes. Only test one -g option, and move it to the end of the + list of options to test. + +Fri Sep 19 17:58:00 1997 Michael Meissner + + * lib/c-torture.exp (TORTURE_OPTIONS): Check for the environment + variable GCC_TORTURE_OPTIONS to supply default switches separated + by colons. If no environment variable, run tests with -O0 -g, -O1 + -g, and -O2 -g as well. + +Wed Sep 17 10:12:26 1997 Bob Manson + + * lib/plumhall.exp: Don't set PHSRC in this file. Add a few + explanatory comments. Fix indentation. Mon Sep 15 00:36:53 1997 Jeffrey A Law (law@cygnus.com) * lib/g++.exp (g++_init): Look for xgcc in $basedir too. - -Thu Sep 11 13:52:01 1997 Jeffrey A Law (law@cygnus.com) + +Thu Sep 11 13:54:47 1997 Jeffrey A Law (law@cygnus.com) * g++.old-deja/g++.brendan/scope4.C: No longer expected to fail. * g++.old-deja/g++.mike/p7325.C: Likewise. @@ -25,9 +47,17 @@ Thu Sep 11 09:53:40 1997 Joe Buck (jbuck@synopsys.com) * g++.old-deja/g++.mike/p784.C: Ditto. * g++.old-deja/g++.mike/p785.C: Ditto. -Fri Sep 5 00:20:39 1997 Richard Henderson (rth@cygnus.com) +Fri Sep 5 00:21:42 1997 Jeffrey A Law (law@cygnus.com) + + * gcc.c-torture/execute/cbrt.c: Tweak to work on more targets. + +Wed Sep 3 17:15:00 1997 Bob Manson - * cbrt.c: Tweak to work on more targets. + * lib/c-torture.exp(c-torture-execute): If the previous and the + current executables being tested are identical, we don't need to + run the executable again. Try to make the executable names + unique. Add an optional argument for passing additional compiler + flags. Tue Sep 2 16:34:31 1997 Doug Evans diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/asm-extn1.C b/gcc/testsuite/g++.old-deja/g++.brendan/asm-extn1.C index a388a61d944..821bd0c6b26 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/asm-extn1.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/asm-extn1.C @@ -1,7 +1,7 @@ // Build don't link: // Special g++ Options: -S // GROUPS passed asm-extension -// excess errors test - XFAIL a29k-*-* +// excess errors test - XFAIL a29k-*-* mn10300-elf // This used to crash because c_expand_asm_keyword didn't know what to // do with this. The parser rules were changed to accept an expr, instead // of a stmt. diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C index faa48eedbee..95da594c2fc 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh1.C @@ -3,6 +3,7 @@ extern "C" void printf (char *, ...); extern "C" int atoi (const char *); +extern "C" void exit (int); struct Exception { @@ -10,7 +11,7 @@ struct Exception Exception(int i) { v = i; }; }; - inc(int &i) + void inc(int &i) { try { if (i == 0) diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C index a6ada1fedb7..2541f2799c7 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh10.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh10.C @@ -9,7 +9,7 @@ void foo() { void ee(int *); -bar() { +void bar() { int i = 2; ee(&i); } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7325.C b/gcc/testsuite/g++.old-deja/g++.mike/p7325.C index f7b04cfcbd0..8402a36cc34 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7325.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p7325.C @@ -1,6 +1,7 @@ // I hate this type of test case. I'm not sure how to code it better. // See the PR for what this tests. // prms-id: 7325 +// execution test fails *-*-* int fail = 0; diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog index 04289808bae..b4a46840fe8 100644 --- a/gcc/testsuite/gcc.c-torture/ChangeLog +++ b/gcc/testsuite/gcc.c-torture/ChangeLog @@ -1,7 +1,25 @@ -Fri Aug 29 12:46:05 1997 Jeffrey A Law (law@cygnus.com) +Wed Sep 3 17:29:35 1997 Bob Manson + + * execute/ieee/ieee.exp: Check for ieee_multilib_flags target + feature; pass this to c-torture-execute as needed. + +Fri Aug 29 12:48:09 1997 Jeffrey A Law (law@cygnus.com) * execute/921007-1.c: Make strcmp static. +Tue Jul 29 00:40:38 1997 J"orn Rennecke + + * conversion.c (test_float_to_integer): Make double precision tests + dependent on sizeof (double). + +Tue Jun 17 22:11:16 1997 J"orn Rennecke + + * compile/961203-1.cexp: New script. + +Wed Jun 4 03:38:50 1997 J"orn Rennecke + + * execute/ieee/ieee.exp: Set -mieee for SH. + Thu May 15 14:00:04 1997 Mike Meissner * execute/va-arg-3.c: If NO_VARARGS is defined, nop test. diff --git a/gcc/testsuite/gcc.c-torture/execute/conversion.c b/gcc/testsuite/gcc.c-torture/execute/conversion.c index 5f358727d8f..fc69d6279ba 100644 --- a/gcc/testsuite/gcc.c-torture/execute/conversion.c +++ b/gcc/testsuite/gcc.c-torture/execute/conversion.c @@ -207,6 +207,11 @@ test_float_to_integer() if (f2u((float) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */ abort(); + /* CYGNUS LOCAL -- amylaar/32bit doubles */ + /* These tests require double precision, so for hosts that don't offer + that much precision, just ignore these test. */ + if (sizeof (double) >= 8) { + /* END CYGNUS LOCAL -- amylaar/32bit doubles */ if (d2u(0.0) != 0) abort(); if (d2u(0.999) != 0) @@ -221,6 +226,9 @@ test_float_to_integer() abort(); if (d2u((double) ~((~0U) >> 1)) != ~((~0U) >> 1)) /* 0x80000000 */ abort(); + /* CYGNUS LOCAL -- amylaar/32bit doubles */ + } + /* END CYGNUS LOCAL -- amylaar/32bit doubles */ if (f2s(0.0) != 0) @@ -240,6 +248,11 @@ test_float_to_integer() if (f2s((float)(int)~((~0U) >> 1)) != (int)~((~0U) >> 1)) /* 0x80000000 */ abort(); + /* CYGNUS LOCAL -- amylaar/32bit doubles */ + /* These tests require double precision, so for hosts that don't offer + that much precision, just ignore these test. */ + if (sizeof (double) >= 8) { + /* END CYGNUS LOCAL -- amylaar/32bit doubles */ if (d2s(0.0) != 0) abort(); if (d2s(0.999) != 0) @@ -258,6 +271,9 @@ test_float_to_integer() abort(); if (d2s((double)(int)~((~0U) >> 1)) != (int)~((~0U) >> 1)) /* 0x80000000 */ abort(); + /* CYGNUS LOCAL -- amylaar/32bit doubles */ + } + /* END CYGNUS LOCAL -- amylaar/32bit doubles */ } #if __GNUC__ diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp index 795dbf167c9..55f7f27625b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp +++ b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp @@ -28,11 +28,17 @@ if $tracelevel then { strace $tracelevel } +if [target_info exists ieee_multilib_flags] { + set additional_flags [target_info ieee_multilib_flags]; +} else { + set additional_flags ""; +} + # load support procs load_lib c-torture.exp # initialize harness -gcc_init +gcc_init # # main test loop @@ -44,7 +50,7 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] { continue } - c-torture-execute $src + c-torture-execute $src $additional_flags } # All done. 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 "*-*-*" } -- 2.30.2