summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rwxr-xr-xgcc/testsuite/lib/f-torture.exp317
-rwxr-xr-xgcc/testsuite/lib/g++-dg.exp83
-rwxr-xr-xgcc/testsuite/lib/g++.exp235
-rwxr-xr-xgcc/testsuite/lib/g77.exp274
-rwxr-xr-xgcc/testsuite/lib/mike-g++.exp264
-rwxr-xr-xgcc/testsuite/lib/mike-g77.exp262
-rwxr-xr-xgcc/testsuite/lib/objc-torture.exp316
-rwxr-xr-xgcc/testsuite/lib/objc.exp269
8 files changed, 0 insertions, 2020 deletions
diff --git a/gcc/testsuite/lib/f-torture.exp b/gcc/testsuite/lib/f-torture.exp
deleted file mode 100755
index 6596b6f..0000000
--- a/gcc/testsuite/lib/f-torture.exp
+++ /dev/null
@@ -1,317 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-dejagnu@gnu.org.
-
-# This file was written by Rob Savoye. (rob@cygnus.com)
-
-# The default option list can be overridden by
-# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
-
-if ![info exists TORTURE_OPTIONS] {
- # FIXME: We should test -g at least once.
- 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 } \
- { -Os }]
-}
-
-
-# Split TORTURE_OPTIONS into two choices: one for testcases with loops and
-# one for testcases without loops.
-
-set torture_with_loops $TORTURE_OPTIONS
-set torture_without_loops ""
-foreach option $TORTURE_OPTIONS {
- if ![string match "*loop*" $option] {
- lappend torture_without_loops $option
- }
-}
-
-#
-# f-torture-compile -- runs the Tege C-torture test
-#
-# SRC is the full pathname of the testcase.
-# OPTION is the specific compiler flag we're testing (eg: -O2).
-#
-proc f-torture-compile { src option } {
- global output
- global srcdir tmpdir
- global host_triplet
-
- set output "$tmpdir/[file tail [file rootname $src]].o"
-
- regsub "^$srcdir/?" $src "" testcase
- # If we couldn't rip $srcdir out of `src' then just do the best we can.
- # The point is to reduce the unnecessary noise in the logs. Don't strip
- # out too much because different testcases with the same name can confuse
- # `test-tool'.
- if [string match "/*" $testcase] {
- set testcase "[file tail [file dirname $src]]/[file tail $src]"
- }
-
- verbose "Testing $testcase, $option" 1
-
- # Run the compiler and analyze the results.
- set options ""
- lappend options "additional_flags=-w $option"
-
- set comp_output [g77_target_compile "$src" "$output" object $options];
-
- # Set a few common compiler messages.
- set fatal_signal "*77*: Internal compiler error: program*got fatal signal"
-
- if [string match "$fatal_signal 6" $comp_output] then {
- g77_fail $testcase "Got Signal 6, $option"
- remote_file build delete $output
- return
- }
-
- if [string match "$fatal_signal 11" $comp_output] then {
- g77_fail $testcase "Got Signal 11, $option"
- remote_file build delete $output
- return
- }
-
- # We shouldn't get these because of -w, but just in case.
- if [string match "*77*:*warning:*" $comp_output] then {
- warning "$testcase: (with warnings) $option"
- send_log "$comp_output\n"
- unresolved "$testcase, $option"
- remote_file build delete $output
- return
- }
-
- set comp_output [prune_warnings $comp_output]
-
- set unsupported_message [g77_check_unsupported_p $comp_output]
- if { $unsupported_message != "" } {
- unsupported "$testcase: $unsupported_message"
- remote_file build delete $output
- return
- }
-
- # remove any leftover LF/CR to make sure any output is legit
- regsub -all -- "\[\r\n\]*" $comp_output "" comp_output
- # If any message remains, we fail.
- if ![string match "" $comp_output] then {
- g77_fail $testcase $option
- remote_file build delete $output
- return
- }
-
- g77_pass $testcase $option
- remote_file build delete $output
-}
-
-#
-# f-torture-execute -- utility to compile and execute a testcase
-#
-# SRC is the full pathname of the testcase.
-#
-# If the testcase has an associated .x file, we source that to run the
-# test instead. We use .x so that we don't lengthen the existing filename
-# to more than 14 chars.
-#
-proc f-torture-execute { src } {
- global tmpdir tool srcdir output
-
- # Check for alternate driver.
- if [file exists [file rootname $src].x] {
- verbose "Using alternate driver [file rootname [file tail $src]].x" 2
- set done_p 0
- catch "set done_p \[source [file rootname $src].x\]"
- if { $done_p } {
- return
- }
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- set executable $tmpdir/[file tail [file rootname $src].x]
-
- regsub "^$srcdir/?" $src "" testcase
- # If we couldn't rip $srcdir out of `src' then just do the best we can.
- # The point is to reduce the unnecessary noise in the logs. Don't strip
- # out too much because different testcases with the same name can confuse
- # `test-tool'.
- if [string match "/*" $testcase] {
- set testcase "[file tail [file dirname $src]]/[file tail $src]"
- }
-
- foreach option $option_list {
- # torture_{compile,execute}_xfail are set by the .x script
- # (if present)
- if [info exists torture_compile_xfail] {
- setup_xfail $torture_compile_xfail
- }
- remote_file build delete $executable
- verbose "Testing $testcase, $option" 1
-
- set options ""
- lappend options "additional_flags=-w $option"
- set comp_output [g77_target_compile "$src" "$executable" executable $options];
-
- # Set a few common compiler messages.
- set fatal_signal "*77*: Internal compiler error: program*got fatal signal"
-
- if [string match "$fatal_signal 6" $comp_output] then {
- g77_fail $testcase "Got Signal 6, $option"
- remote_file build delete $executable
- continue
- }
-
- if [string match "$fatal_signal 11" $comp_output] then {
- g77_fail $testcase "Got Signal 11, $option"
- remote_file build delete $executable
- continue
- }
-
- # We shouldn't get these because of -w, but just in case.
- if [string match "*77*:*warning:*" $comp_output] then {
- warning "$testcase: (with warnings) $option"
- send_log "$comp_output\n"
- unresolved "$testcase, $option"
- remote_file build delete $executable
- continue
- }
-
- set comp_output [prune_warnings $comp_output]
-
- set unsupported_message [g77_check_unsupported_p $comp_output]
-
- if { $unsupported_message != "" } {
- unsupported "$testcase: $unsupported_message"
- continue
- } elseif ![file exists $executable] {
- if ![is3way] {
- fail "$testcase compilation, $option"
- untested "$testcase execution, $option"
- continue
- } else {
- # FIXME: since we can't test for the existance of a remote
- # file without short of doing an remote file list, we assume
- # that since we got no output, it must have compiled.
- pass "$testcase compilation, $option"
- }
- } else {
- pass "$testcase compilation, $option"
- }
-
- # See if this source file uses "long long" types, if it does, and
- # no_long_long is set, skip execution of the test.
- if [target_info exists no_long_long] then {
- if [expr [search_for $src "integer\*8"]] then {
- untested "$testcase execution, $option"
- continue
- }
- }
-
- if [info exists torture_execute_xfail] {
- setup_xfail $torture_execute_xfail
- }
-
- set result [g77_load "$executable" "" ""]
- set status [lindex $result 0];
- set output [lindex $result 1];
- if { $status == "pass" } {
- remote_file build delete $executable
- }
- $status "$testcase execution, $option"
- }
-}
-
-#
-# search_for -- looks for a string match in a file
-#
-proc search_for { file pattern } {
- set fd [open $file r]
- while { [gets $fd cur_line]>=0 } {
- set lower [string tolower $cur_line]
- if [regexp "$pattern" $lower] then {
- close $fd
- return 1
- }
- }
- close $fd
- return 0
-}
-
-#
-# f-torture -- the f-torture testcase source file processor
-#
-# This runs compilation only tests (no execute tests).
-# SRC is the full pathname of the testcase, or just a file name in which case
-# we prepend $srcdir/$subdir.
-#
-# If the testcase has an associated .x file, we source that to run the
-# test instead. We use .x so that we don't lengthen the existing filename
-# to more than 14 chars.
-#
-proc f-torture { args } {
- global srcdir subdir
-
- set src [lindex $args 0];
- if { [llength $args] > 1 } {
- set options [lindex $args 1];
- } else {
- set options ""
- }
-
- # Prepend $srdir/$subdir if missing.
- if ![string match "*/*" $src] {
- set src "$srcdir/$subdir/$src"
- }
-
- # Check for alternate driver.
- if [file exists [file rootname $src].x] {
- verbose "Using alternate driver [file rootname [file tail $src]].x" 2
- set done_p 0
- catch "set done_p \[source [file rootname $src].x\]"
- if { $done_p } {
- return
- }
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- # loop through all the options
- foreach option $option_list {
- # torture_compile_xfail is set by the .x script (if present)
- if [info exists torture_compile_xfail] {
- setup_xfail $torture_compile_xfail
- }
-
- f-torture-compile $src "$option $options"
- }
-}
diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
deleted file mode 100755
index cad429e..0000000
--- a/gcc/testsuite/lib/g++-dg.exp
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 1997, 1999 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-g++@prep.ai.mit.edu
-
-# Define g++ callbacks for dg.exp.
-
-load_lib dg.exp
-
-proc g++-dg-test { prog do_what extra_tool_flags } {
- # Set up the compiler flags, based on what we're going to do.
-
- switch $do_what {
- "preprocess" {
- set compile_type "preprocess"
- set output_file "[file rootname [file tail $prog]].i"
- }
- "compile" {
- set compile_type "assembly"
- set output_file "[file rootname [file tail $prog]].s"
- }
- "assemble" {
- set compile_type "object"
- set output_file "[file rootname [file tail $prog]].o"
- }
- "link" {
- set compile_type "executable"
- set output_file "a.out"
- # The following line is needed for targets like the i960 where
- # the default output file is b.out. Sigh.
- }
- "run" {
- set compile_type "executable"
- # FIXME: "./" is to cope with "." not being in $PATH.
- # Should this be handled elsewhere?
- # YES.
- set output_file "./a.out"
- # This is the only place where we care if an executable was
- # created or not. If it was, dg.exp will try to run it.
- remote_file build delete $output_file;
- }
- default {
- perror "$do_what: not a valid dg-do keyword"
- return ""
- }
- }
- set options ""
- if { $extra_tool_flags != "" } {
- lappend options "additional_flags=$extra_tool_flags"
- }
-
- set comp_output [g++_target_compile "$prog" "$output_file" "$compile_type" $options];
-
- return [list $comp_output $output_file]
-}
-
-
-proc g++-dg-prune { system text } {
-
- # If we see "region xxx is full" then the testcase is too big for ram.
- # This is tricky to deal with in a large testsuite like c-torture so
- # deal with it here. Just mark the testcase as unsupported.
- if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $text] {
- # The format here is important. See dg.exp.
- return "::unsupported::memory full"
- }
-
- return $text
-}
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
deleted file mode 100755
index 27b444e..0000000
--- a/gcc/testsuite/lib/g++.exp
+++ /dev/null
@@ -1,235 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-g++@prep.ai.mit.edu
-
-# This file was written by Rob Savoye (rob@cygnus.com)
-# Many modifications by Jeffrey Wheat (cassidy@cygnus.com)
-# With modifications by Mike Stump <mrs@cygnus.com>.
-
-#
-# g++ support library routines
-#
-
-#
-# GXX_UNDER_TEST is the compiler under test.
-#
-
-
-set gpp_compile_options ""
-
-#
-# g++_version -- extract and print the version number of the compiler
-#
-proc g++_version { } {
- global GXX_UNDER_TEST
-
- # ignore any arguments after the command
- set compiler [lindex $GXX_UNDER_TEST 0]
-
- # verify that the compiler exists
- if { [is_remote host] || [which $compiler] != 0 } then {
- set tmp [remote_exec host "$compiler -v"]
- set status [lindex $tmp 0];
- set output [lindex $tmp 1];
- regexp "version.*$" $output version
- if { $status == 0 && [info exists version] } then {
- if [is_remote host] {
- clone_output "$compiler $version\n"
- } else {
- clone_output "[which $compiler] $version\n"
- }
- } else {
- clone_output "Couldn't determine version of [which $compiler]\n"
- }
- } else {
- # compiler does not exist (this should have already been detected)
- warning "$compiler does not exist"
- }
-}
-
-#
-# g++_init -- called at the start of each subdir of tests
-#
-
-proc g++_init { args } {
- global subdir
- global gpp_initialized
- global base_dir
- global tmpdir
- global libdir
- global gluefile wrap_flags;
- global objdir srcdir
- global ALWAYS_CXXFLAGS
- global TOOL_EXECUTABLE TOOL_OPTIONS
- global GXX_UNDER_TEST
-
- if ![info exists GXX_UNDER_TEST] then {
- if [info exists TOOL_EXECUTABLE] {
- set GXX_UNDER_TEST $TOOL_EXECUTABLE;
- } else {
- if [is_remote host] {
- set GXX_UNDER_TEST [transform c++]
- } else {
- set GXX_UNDER_TEST [findfile $base_dir/../xgcc "$base_dir/../xgcc -B$base_dir/../" [findfile $base_dir/xgcc "$base_dir/xgcc -B$base_dir/" [transform c++]]]
- }
- }
- }
-
- # Bleah, nasty. Bad taste.
- if [ishost "*-dos-*" ] {
- regsub "c\\+\\+" "$GXX_UNDER_TEST" "gcc" GXX_UNDER_TEST
- }
-
- if ![is_remote host] {
- if { [which $GXX_UNDER_TEST] == 0 } then {
- perror "GXX_UNDER_TEST does not exist"
- exit 1
- }
- }
- if ![info exists tmpdir] {
- set tmpdir "/tmp"
- }
-
- if [info exists gluefile] {
- unset gluefile
- }
-
- if { [target_info needs_status_wrapper] != "" } {
- set gluefile ${tmpdir}/testglue.o;
- set result [build_wrapper $gluefile];
- if { $result != "" } {
- set gluefile [lindex $result 0];
- set wrap_flags [lindex $result 1];
- } else {
- unset gluefile
- }
- }
-
- set ALWAYS_CXXFLAGS ""
-
- if ![is_remote host] {
- lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags]";
- lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags]";
- lappend ALWAYS_CXXFLAGS "incdir=$base_dir/../include"
- }
-
- if [info exists TOOL_OPTIONS] {
- lappend ALWAYS_CXXFLAGS "additional_flags=$TOOL_OPTIONS";
- }
-
- verbose -log "ALWAYS_CXXFLAGS set to $ALWAYS_CXXFLAGS"
-
- verbose "g++ is initialized" 3
-}
-
-
-proc g++_target_compile { source dest type options } {
- global tmpdir;
- global gpp_compile_options
- global gluefile wrap_flags
- global ALWAYS_CXXFLAGS;
- global GXX_UNDER_TEST;
-
- if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=${wrap_flags}"
- }
-
- lappend options "additional_flags=[libio_include_flags]"
- lappend options "compiler=$GXX_UNDER_TEST";
-
- set options [concat $options $gpp_compile_options]
-
- set options [concat $options "$ALWAYS_CXXFLAGS"];
-
- if { [regexp "(^| )-frepo( |$)" $options] && \
- [regexp "\.o(|bj)$" $dest] } then {
- regsub "\.o(|bj)$" $dest ".rpo" rponame
- exec rm -f $rponame
- }
-
- return [target_compile $source $dest $type $options]
-}
-
-proc g++_exit { args } {
- global gluefile;
-
- if [info exists gluefile] {
- file_on_build delete $gluefile;
- unset gluefile;
- }
-}
-
-# If this is an older version of dejagnu (without runtest_file_p),
-# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c.
-# This can be deleted after the next dejagnu release.
-
-if { [info procs runtest_file_p] == "" } then {
- proc runtest_file_p { runtests testcase } {
- if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then {
- if { [lsearch $runtests [file tail $testcase]] >= 0 } then {
- return 1
- } else {
- return 0
- }
- }
- return 1
- }
-}
-
-# Provide a definition of this if missing (delete after next dejagnu release).
-
-if { [info procs prune_warnings] == "" } then {
- proc prune_warnings { text } {
- return $text
- }
-}
-
-# Utility used by mike-g++.exp and old-dejagnu.exp.
-# Check the compiler(/assembler/linker) output for text indicating that
-# the testcase should be marked as "unsupported".
-#
-# When dealing with a large number of tests, it's difficult to weed out the
-# ones that are too big for a particular cpu (eg: 16 bit with a small amount
-# of memory). There are various ways to deal with this. Here's one.
-# Fortunately, all of the cases where this is likely to happen will be using
-# gld so we can tell what the error text will look like.
-
-proc ${tool}_check_unsupported_p { output } {
- if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
- return "memory full"
- }
- return ""
-}
-
-proc ${tool}_option_help { } {
- send_user "--additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated."
-}
-
-proc ${tool}_option_proc { option } {
- if[regexp "^--additional_options," $option] {
- global gpp_compile_options
- regsub "--additional_options," $option "" option
- foreach x [split $option ","] {
- lappend gpp_compile_options "additional_flags=$x"
- }
- return 1;
- } else {
- return 0
- }
-}
diff --git a/gcc/testsuite/lib/g77.exp b/gcc/testsuite/lib/g77.exp
deleted file mode 100755
index 3b2beb3..0000000
--- a/gcc/testsuite/lib/g77.exp
+++ /dev/null
@@ -1,274 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-g77@prep.ai.mit.edu
-
-# This file was written by Rob Savoye (rob@cygnus.com)
-# Currently maintained by Doug Evans (dje@cygnus.com)
-
-# This file is loaded by the tool init file (eg: unix.exp). It provides
-# default definitions for g77_start, etc. and other supporting cast members.
-
-# These globals are used by g77_start if no compiler arguments are provided.
-# They are also used by the various testsuites to define the environment:
-# where to find stdio.h, libc.a, etc.
-
-#
-# G77_UNDER_TEST is the compiler under test.
-#
-
-#
-# default_g77_version -- extract and print the version number of the compiler
-#
-
-proc default_g77_version { } {
- global G77_UNDER_TEST
-
- g77_init;
-
- # ignore any arguments after the command
- set compiler [lindex $G77_UNDER_TEST 0]
-
- if ![is_remote host] {
- set compiler_name [which $compiler];
- } else {
- set compiler_name $compiler;
- }
-
- # verify that the compiler exists
- if { $compiler_name != 0 } then {
- set options ""
-
- lappend options "additional_flags=-v"
- set tmp [g77_target_compile "" "" "none" $options]
- regexp "g77 version\[^\n\]*" $tmp version
- if { [info exists version] } then {
- clone_output "$compiler_name $version\n"
- } else {
- clone_output "Couldn't determine version of $compiler_name: $tmp\n"
- }
- } else {
- # compiler does not exist (this should have already been detected)
- warning "$compiler does not exist"
- }
-}
-
-#
-# Call g77_version. We do it this way so we can override it if needed.
-#
-proc g77_version { } {
- default_g77_version;
-}
-
-#
-# g77_init -- called at the start of each .exp script.
-#
-# There currently isn't much to do, but always using it allows us to
-# make some enhancements without having to go back and rewrite the scripts.
-#
-
-set g77_initialized 0
-
-proc g77_init { args } {
- global tmpdir
- global libdir
- global gluefile wrap_flags
- global g77_initialized
- global G77_UNDER_TEST
- global TOOL_EXECUTABLE
-
- if { $g77_initialized == 1 } { return; }
-
- if ![info exists G77_UNDER_TEST] then {
- if [info exists TOOL_EXECUTABLE] {
- set G77_UNDER_TEST $TOOL_EXECUTABLE;
- } else {
- set G77_UNDER_TEST [find_g77]
- }
- }
-
- if ![info exists tmpdir] then {
- set tmpdir /tmp
- }
- if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
- set gluefile ${tmpdir}/testglue.o;
- set result [build_wrapper $gluefile];
- if { $result != "" } {
- set gluefile [lindex $result 0];
- set wrap_flags [lindex $result 1];
- } else {
- unset gluefile
- }
- }
-}
-
-proc g77_target_compile { source dest type options } {
- global tmpdir;
- global gluefile wrap_flags;
- global G77_UNDER_TEST
- global TOOL_OPTIONS
-
- if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=$wrap_flags"
- }
-
- if [target_info exists g77,stack_size] {
- lappend options "additional_flags=-DSTACK_SIZE=[target_info g77,stack_size]"
- }
- if [target_info exists g77,no_trampolines] {
- lappend options "additional_flags=-DNO_TRAMPOLINES"
- }
- if [target_info exists g77,no_label_values] {
- lappend options "additional_flags=-DNO_LABEL_VALUES"
- }
- if [info exists TOOL_OPTIONS] {
- lappend options "additional_flags=$TOOL_OPTIONS"
- }
- if [target_info exists g77,no_varargs] {
- lappend options "additional_flags=-DNO_VARARGS"
- }
- if ![is_remote host] {
- set gccpath "[get_multilibs]"
- set libg2c_dir [lookfor_file ${gccpath} libf2c/libg2c.a]
- if { $libg2c_dir != "" } {
- set libg2c_link_flags "-L[file dirname ${libg2c_dir}]"
- lappend options "additional_flags=${libg2c_link_flags}"
- }
- }
- lappend options "compiler=$G77_UNDER_TEST"
- return [target_compile $source $dest $type $options]
-}
-
-#
-# g77_pass -- utility to record a testcase passed
-#
-
-proc g77_pass { testcase cflags } {
- if { "$cflags" == "" } {
- pass "$testcase"
- } else {
- pass "$testcase, $cflags"
- }
-}
-
-#
-# g77_fail -- utility to record a testcase failed
-#
-
-proc g77_fail { testcase cflags } {
- if { "$cflags" == "" } {
- fail "$testcase"
- } else {
- fail "$testcase, $cflags"
- }
-}
-
-#
-# g77_finish -- called at the end of every .exp script that calls g77_init
-#
-# The purpose of this proc is to hide all quirks of the testing environment
-# from the testsuites. It also exists to undo anything that g77_init did
-# (that needs undoing).
-#
-
-proc g77_finish { } {
- # The testing harness apparently requires this.
- global errorInfo;
-
- if [info exists errorInfo] then {
- unset errorInfo
- }
-
- # Might as well reset these (keeps our caller from wondering whether
- # s/he has to or not).
- global prms_id bug_id
- set prms_id 0
- set bug_id 0
-}
-
-proc g77_exit { } {
- global gluefile;
-
- if [info exists gluefile] {
- file_on_build delete $gluefile;
- unset gluefile;
- }
-}
-
-# If this is an older version of dejagnu (without runtest_file_p),
-# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c.
-# This can be deleted after next dejagnu release.
-
-if { [info procs runtest_file_p] == "" } then {
- proc runtest_file_p { runtests testcase } {
- if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then {
- if { [lsearch $runtests [file tail $testcase]] >= 0 } then {
- return 1
- } else {
- return 0
- }
- }
- return 1
- }
-}
-
-# Provide a definition of this if missing (delete after next dejagnu release).
-
-if { [info procs prune_warnings] == "" } then {
- proc prune_warnings { text } {
- return $text
- }
-}
-
-# Utility used by mike-gcc.exp and c-torture.exp.
-# Check the compiler(/assembler/linker) output for text indicating that
-# the testcase should be marked as "unsupported".
-#
-# When dealing with a large number of tests, it's difficult to weed out the
-# ones that are too big for a particular cpu (eg: 16 bit with a small amount
-# of memory). There are various ways to deal with this. Here's one.
-# Fortunately, all of the cases where this is likely to happen will be using
-# gld so we can tell what the error text will look like.
-
-proc ${tool}_check_unsupported_p { output } {
- if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
- return "memory full"
- }
- return ""
-}
-
-# Prune messages from g77 that aren't useful.
-
-proc prune_g77_output { text } {
- #send_user "Before:$text\n"
- regsub -all "(^|\n)\[^\n\]*: In (function|method) \[^\n\]*" $text "" text
- regsub -all "(^|\n)\[^\n\]*: At top level:\[^\n\]*" $text "" text
-
- # It would be nice to avoid passing anything to g77 that would cause it to
- # issue these messages (since ignoring them seems like a hack on our part),
- # but that's too difficult in the general case. For example, sometimes
- # you need to use -B to point g77 at crt0.o, but there are some targets
- # that don't have crt0.o.
- regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text
- regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text
-
- #send_user "After:$text\n"
-
- return $text
-}
-
diff --git a/gcc/testsuite/lib/mike-g++.exp b/gcc/testsuite/lib/mike-g++.exp
deleted file mode 100755
index 10a1d2b..0000000
--- a/gcc/testsuite/lib/mike-g++.exp
+++ /dev/null
@@ -1,264 +0,0 @@
-# Copyright (C) 1988, 90, 91, 92, 95, 96, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# This file was written by Mike Stump <mrs@cygnus.com>
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-g++@prep.ai.mit.edu
-
-#
-# mike_cleanup -- remove any files that are created by the testcase
-#
-proc mike_cleanup { src_code output_file assembly_file } {
- remote_file build delete $output_file $assembly_file;
-}
-
-#
-# prebase -- sets up a Mike Stump (mrs@cygnus.com) style G++ test
-#
-proc prebase { } {
- global compiler_output
- global not_compiler_output
- global compiler_result
- global not_compiler_result
- global program_output
- global groups
- global run
- global actions
- global target_regexp
-
- set compiler_output "^$"
- set not_compiler_output ".*Internal compiler error.*"
- set compiler_result ""
- set not_compiler_result ""
- set program_output ".*PASS.*"
- set groups {}
- set run no
- set actions assemble
- set target_regexp ".*"
-}
-
-#
-# run the test
-#
-proc postbase { src_code run groups args } {
- global verbose
- global srcdir
- global subdir
- global not_compiler_output
- global compiler_output
- global compiler_result
- global not_compiler_result
- global program_output
- global actions
- global target_regexp
- global host_triplet
- global target_triplet
- global tool
- global tmpdir
- global objdir
- global base_dir
-
- if ![regexp $target_regexp $target_triplet] {
- unsupported $subdir/$src_code
- return
- }
-
- if { [llength $args] > 0 } {
- set comp_options [lindex $args 0];
- } else {
- set comp_options ""
- }
-
- set fail_message $subdir/$src_code
- set pass_message $subdir/$src_code
-
- if [info exists GROUP] {
- if {[lsearch $groups $GROUP] == -1} {
- return
- }
- }
-
- if [string match $run yes] {
- set actions run
- }
-
- set output_file "$tmpdir/[file tail [file rootname $src_code]]"
- set assembly_file "$output_file"
- append assembly_file ".S"
-
- set compile_type "none"
-
- case $actions {
- compile
- {
- set compile_type "assembly";
- set output_file $assembly_file;
- }
- assemble
- {
- set compile_type "object";
- append output_file ".o";
- }
- link
- {
- set compile_type "executable";
- set output_file "$tmpdir/a.out";
- }
- run
- {
- set compile_type "executable";
- set output_file "$tmpdir/a.out";
- set run yes;
- }
- default
- {
- set output_file "";
- set compile_type "none";
- }
- }
-
- set src_file "$srcdir/$subdir/$src_code"
- set options ""
-
- if { $comp_options != "" } {
- lappend options "additional_flags=$comp_options"
- }
-
- if ![ishost "*-dos-*"] {
- lappend options "libs=-lstdc++ -lg++"
- } else {
- lappend options "libs=-lstdcxx -lgxx"
- }
-
- set comp_output [g++_target_compile $src_file $output_file $compile_type $options]
-
- set pass no
-
- # Delete things like "ld.so warning" messages.
- set comp_output [prune_warnings $comp_output]
-
- if [regexp -- $not_compiler_output $comp_output] {
- if { $verbose > 1 } {
- send_user "\nChecking:\n$not_compiler_output\nto make sure it does not match:\n$comp_output\nbut it does.\n\n"
- } else {
- send_log "\nCompiler output:\n$comp_output\n\n"
- }
- fail $fail_message
- # The framework doesn't like to see any error remnants,
- # so remove them.
- uplevel {
- if [info exists errorInfo] {
- unset errorInfo
- }
- }
- mike_cleanup $src_code $output_file $assembly_file
- return
- }
-
- # remove any leftover CRs.
- regsub -all -- "\r" $comp_output "" comp_output
-
- regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
- regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
-
- set unsupported_message [${tool}_check_unsupported_p $comp_output]
- if { $unsupported_message != "" } {
- unsupported "$subdir/$src_code: $unsupported_message"
- mike_cleanup $src_code $output_file $assembly_file
- return
- }
-
- if { $verbose > 1 } {
- send_user "\nChecking:\n$compiler_output\nto see if it matches:\n$comp_output\n"
- } else {
- send_log "\nCompiler output:\n$comp_output\n\n"
- }
- if [regexp -- $compiler_output $comp_output] {
- if { $verbose > 1 } {
- send_user "Yes, it matches.\n\n"
- }
- set pass yes
- if [file exists [file rootname [file tail $src_code]].s] {
- set fd [open [file rootname [file tail $src_code]].s r]
- set dot_s [read $fd]
- close $fd
- if { $compiler_result != "" } {
- verbose "Checking .s file for $compiler_result" 2
- if [regexp -- $compiler_result $dot_s] {
- verbose "Yes, it matches." 2
- } else {
- verbose "Nope, doesn't match." 2
- verbose $dot_s 4
- set pass no
- }
- }
- if { $not_compiler_result != "" } {
- verbose "Checking .s file for not $not_compiler_result" 2
- if ![regexp -- $not_compiler_result $dot_s] {
- verbose "Nope, not found (that's good)." 2
- } else {
- verbose "Uh oh, it was found." 2
- verbose $dot_s 4
- set pass no
- }
- }
- }
- if [string match $run yes] {
- set result [g++_load $output_file]
- set status [lindex $result 0];
- set output [lindex $result 1];
-
- if { $status == -1 } {
- mike_cleanup $src_code $output_file $assembly_file;
- return;
- }
- if { $verbose > 1 } {
- send_user "Checking:\n$program_output\nto see if it matches:\n$output\n\n"
- }
- if ![regexp -- $program_output $output] {
- set pass no
- if { $verbose > 1 } {
- send_user "Nope, does not match.\n\n"
- }
- } else {
- if { $verbose > 1 } {
- send_user "Yes, it matches.\n\n"
- }
- }
- }
- } else {
- if { $verbose > 1 } {
- send_user "Nope, does not match.\n\n"
- }
- }
-
- if [string match $pass "yes"] {
- pass $pass_message
- } else {
- fail $fail_message
- }
-
- # The framework doesn't like to see any error remnants,
- # so remove them.
- uplevel {
- if [info exists errorInfo] {
- unset errorInfo
- }
- }
-
- mike_cleanup $src_code $output_file $assembly_file
-}
diff --git a/gcc/testsuite/lib/mike-g77.exp b/gcc/testsuite/lib/mike-g77.exp
deleted file mode 100755
index a3e12d4..0000000
--- a/gcc/testsuite/lib/mike-g77.exp
+++ /dev/null
@@ -1,262 +0,0 @@
-# Copyright (C) 1988, 90, 91, 92, 95, 96, 97, 1998 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# This file was derived from mike-g++.exp written by Mike Stump <mrs@cygnus.com>
-
-# Please email any bugs, comments, and/or additions to this file to:
-# fortran@gnu.org
-
-#
-# mike_cleanup -- remove any files that are created by the testcase
-#
-proc mike_cleanup { src_code output_file assembly_file } {
- remote_file build delete $output_file $assembly_file;
-}
-
-#
-# prebase -- sets up a Mike Stump (mrs@cygnus.com) style g77 test
-#
-proc prebase { } {
- global compiler_output
- global not_compiler_output
- global compiler_result
- global not_compiler_result
- global program_output
- global groups
- global run
- global actions
- global target_regexp
-
- set compiler_output "^$"
- set not_compiler_output ".*Internal compiler error.*"
- set compiler_result ""
- set not_compiler_result ""
- set program_output ".*PASS.*"
- set groups {}
- set run no
- set actions assemble
- set target_regexp ".*"
-}
-
-#
-# run the test
-#
-proc postbase { src_code run groups args } {
- global verbose
- global srcdir
- global subdir
- global not_compiler_output
- global compiler_output
- global compiler_result
- global not_compiler_result
- global program_output
- global actions
- global target_regexp
- global host_triplet
- global target_triplet
- global tool
- global tmpdir
- global G77_UNDER_TEST
- global GROUP
-
- if ![info exists G77_UNDER_TEST] {
- error "No compiler specified for testing."
- }
-
- if ![regexp $target_regexp $target_triplet] {
- unsupported $subdir/$src_code
- return
- }
-
- if { [llength $args] > 0 } {
- set comp_options [lindex $args 0];
- } else {
- set comp_options ""
- }
-
- set fail_message $subdir/$src_code
- set pass_message $subdir/$src_code
-
- if [info exists GROUP] {
- if {[lsearch $groups $GROUP] == -1} {
- return
- }
- }
-
- if [string match $run yes] {
- set actions run
- }
-
- set output_file "$tmpdir/[file tail [file rootname $src_code]]"
- set assembly_file "$output_file"
- append assembly_file ".S"
-
- set compile_type "none"
-
- case $actions {
- compile
- {
- set compile_type "assembly";
- set output_file $assembly_file;
- }
- assemble
- {
- set compile_type "object";
- append output_file ".o";
- }
- link
- {
- set compile_type "executable";
- set output_file "$tmpdir/a.out";
- }
- run
- {
- set compile_type "executable";
- set output_file "$tmpdir/a.out";
- set run yes;
- }
- default
- {
- set output_file "";
- set compile_type "none";
- }
- }
-
- set src_file "$srcdir/$subdir/$src_code"
- set options ""
- lappend options "compiler=$G77_UNDER_TEST"
-
- if { $comp_options != "" } {
- lappend options "additional_flags=$comp_options"
- }
-
- set comp_output [g77_target_compile $src_file $output_file $compile_type $options];
-
- set pass no
-
- # Delete things like "ld.so warning" messages.
- set comp_output [prune_warnings $comp_output]
-
- if [regexp -- $not_compiler_output $comp_output] {
- if { $verbose > 1 } {
- send_user "\nChecking:\n$not_compiler_output\nto make sure it does not match:\n$comp_output\nbut it does.\n\n"
- } else {
- send_log "\nCompiler output:\n$comp_output\n\n"
- }
- fail $fail_message
- # The framework doesn't like to see any error remnants,
- # so remove them.
- uplevel {
- if [info exists errorInfo] {
- unset errorInfo
- }
- }
- mike_cleanup $src_code $output_file $assembly_file
- return
- }
-
- # remove any leftover CRs.
- regsub -all -- "\r" $comp_output "" comp_output
-
- regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
- regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
-
- set unsupported_message [${tool}_check_unsupported_p $comp_output]
- if { $unsupported_message != "" } {
- unsupported "$subdir/$src_code: $unsupported_message"
- mike_cleanup $src_code $output_file $assembly_file
- return
- }
-
- if { $verbose > 1 } {
- send_user "\nChecking:\n$compiler_output\nto see if it matches:\n$comp_output\n"
- } else {
- send_log "\nCompiler output:\n$comp_output\n\n"
- }
- if [regexp -- $compiler_output $comp_output] {
- if { $verbose > 1 } {
- send_user "Yes, it matches.\n\n"
- }
- set pass yes
- if [file exists [file rootname [file tail $src_code]].s] {
- set fd [open [file rootname [file tail $src_code]].s r]
- set dot_s [read $fd]
- close $fd
- if { $compiler_result != "" } {
- verbose "Checking .s file for $compiler_result" 2
- if [regexp -- $compiler_result $dot_s] {
- verbose "Yes, it matches." 2
- } else {
- verbose "Nope, doesn't match." 2
- verbose $dot_s 4
- set pass no
- }
- }
- if { $not_compiler_result != "" } {
- verbose "Checking .s file for not $not_compiler_result" 2
- if ![regexp -- $not_compiler_result $dot_s] {
- verbose "Nope, not found (that's good)." 2
- } else {
- verbose "Uh oh, it was found." 2
- verbose $dot_s 4
- set pass no
- }
- }
- }
- if [string match $run yes] {
- set result [g77_load $output_file]
- set status [lindex $result 0];
- set output [lindex $result 1];
- if { $status == -1 } {
- mike_cleanup $src_code $output_file $assembly_file;
- return;
- }
- if { $verbose > 1 } {
- send_user "Checking:\n$program_output\nto see if it matches:\n$output\n\n"
- }
- if ![regexp -- $program_output $output] {
- set pass no
- if { $verbose > 1 } {
- send_user "Nope, does not match.\n\n"
- }
- } else {
- if { $verbose > 1 } {
- send_user "Yes, it matches.\n\n"
- }
- }
- }
- } else {
- if { $verbose > 1 } {
- send_user "Nope, does not match.\n\n"
- }
- }
-
- if [string match $pass "yes"] {
- pass $pass_message
- } else {
- fail $fail_message
- }
-
- # The framework doesn't like to see any error remnants,
- # so remove them.
- uplevel {
- if [info exists errorInfo] {
- unset errorInfo
- }
- }
-
- mike_cleanup $src_code $output_file $assembly_file
-}
diff --git a/gcc/testsuite/lib/objc-torture.exp b/gcc/testsuite/lib/objc-torture.exp
deleted file mode 100755
index 5eadd48..0000000
--- a/gcc/testsuite/lib/objc-torture.exp
+++ /dev/null
@@ -1,316 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-dejagnu.prep.ai.mit.edu
-
-# This file was written by Rob Savoye. (rob@cygnus.com)
-
-# The default option list can be overridden by
-# TORTURE_OPTIONS="{ { list1 } ... { listN } }"
-
-if ![info exists TORTURE_OPTIONS] {
- # FIXME: We should test -g at least once.
- set TORTURE_OPTIONS [list { -O }]
-}
-
-
-# Split TORTURE_OPTIONS into two choices: one for testcases with loops and
-# one for testcases without loops.
-
-set torture_with_loops $TORTURE_OPTIONS
-set torture_without_loops ""
-foreach option $TORTURE_OPTIONS {
- if ![string match "*loop*" $option] {
- lappend torture_without_loops $option
- }
-}
-
-#
-# objc-torture-compile -- runs the Tege C-torture test
-#
-# SRC is the full pathname of the testcase.
-# OPTION is the specific compiler flag we're testing (eg: -O2).
-#
-proc objc-torture-compile { src option } {
- global output
- global srcdir tmpdir
- global host_triplet
-
- set output "$tmpdir/[file tail [file rootname $src]].o"
-
- regsub "^$srcdir/?" $src "" testcase
- # If we couldn't rip $srcdir out of `src' then just do the best we can.
- # The point is to reduce the unnecessary noise in the logs. Don't strip
- # out too much because different testcases with the same name can confuse
- # `test-tool'.
- if [string match "/*" $testcase] {
- set testcase "[file tail [file dirname $src]]/[file tail $src]"
- }
-
- verbose "Testing $testcase, $option" 1
-
- # Run the compiler and analyze the results.
- set options ""
- lappend options "additional_flags=-w $option"
-
- set comp_output [objc_target_compile "$src" "$output" object $options];
-
- # Set a few common compiler messages.
- set fatal_signal "*77*: Internal compiler error: program*got fatal signal"
-
- if [string match "$fatal_signal 6" $comp_output] then {
- objc_fail $testcase "Got Signal 6, $option"
- remote_file build delete $output
- return
- }
-
- if [string match "$fatal_signal 11" $comp_output] then {
- objc_fail $testcase "Got Signal 11, $option"
- remote_file build delete $output
- return
- }
-
- # We shouldn't get these because of -w, but just in case.
- if [string match "*77*:*warning:*" $comp_output] then {
- warning "$testcase: (with warnings) $option"
- send_log "$comp_output\n"
- unresolved "$testcase, $option"
- remote_file build delete $output
- return
- }
-
- set comp_output [prune_warnings $comp_output]
-
- set unsupported_message [objc_check_unsupported_p $comp_output]
- if { $unsupported_message != "" } {
- unsupported "$testcase: $unsupported_message"
- remote_file build delete $output
- return
- }
-
- # remove any leftover LF/CR to make sure any output is legit
- regsub -all -- "\[\r\n\]*" $comp_output "" comp_output
- # If any message remains, we fail.
- if ![string match "" $comp_output] then {
- objc_fail $testcase $option
- remote_file build delete $output
- return
- }
-
- objc_pass $testcase $option
- remote_file build delete $output
-}
-
-#
-# objc-torture-execute -- utility to compile and execute a testcase
-#
-# SRC is the full pathname of the testcase.
-#
-# If the testcase has an associated .cexp file, we source that to run the
-# test instead. We use .cexp instead of .exp so that the testcase is still
-# controlled by the main .exp driver (this is useful when one wants to only
-# 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 objc-torture-execute { src } {
- global tmpdir tool srcdir output
-
- # Check for alternate driver.
- if [file exists [file rootname $src].cexp] {
- verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
- set done_p 0
- catch "set done_p \[source [file rootname $src].cexp\]"
- if { $done_p } {
- return
- }
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- set executable $tmpdir/[file tail [file rootname $src].x]
-
- regsub "^$srcdir/?" $src "" testcase
- # If we couldn't rip $srcdir out of `src' then just do the best we can.
- # The point is to reduce the unnecessary noise in the logs. Don't strip
- # out too much because different testcases with the same name can confuse
- # `test-tool'.
- if [string match "/*" $testcase] {
- set testcase "[file tail [file dirname $src]]/[file tail $src]"
- }
-
- foreach option $option_list {
- # 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
- verbose "Testing $testcase, $option" 1
-
- set options ""
- lappend options "additional_flags=-w $option -I${srcdir}/../../libobjc"
- set comp_output [objc_target_compile "$src" "$executable" executable $options];
-
- # Set a few common compiler messages.
- set fatal_signal "*77*: Internal compiler error: program*got fatal signal"
-
- if [string match "$fatal_signal 6" $comp_output] then {
- objc_fail $testcase "Got Signal 6, $option"
- remote_file build delete $executable
- continue
- }
-
- if [string match "$fatal_signal 11" $comp_output] then {
- objc_fail $testcase "Got Signal 11, $option"
- remote_file build delete $executable
- continue
- }
-
- # We shouldn't get these because of -w, but just in case.
- if [string match "*77*:*warning:*" $comp_output] then {
- warning "$testcase: (with warnings) $option"
- send_log "$comp_output\n"
- unresolved "$testcase, $option"
- remote_file build delete $executable
- continue
- }
-
- set comp_output [prune_warnings $comp_output]
-
- set unsupported_message [objc_check_unsupported_p $comp_output]
-
- if { $unsupported_message != "" } {
- unsupported "$testcase: $unsupported_message"
- continue
- } elseif ![file exists $executable] {
- if ![is3way] {
- fail "$testcase compilation, $option"
- untested "$testcase execution, $option"
- continue
- } else {
- # FIXME: since we can't test for the existance of a remote
- # file without short of doing an remote file list, we assume
- # that since we got no output, it must have compiled.
- pass "$testcase compilation, $option"
- }
- } else {
- pass "$testcase compilation, $option"
- }
-
- # See if this source file uses "long long" types, if it does, and
- # no_long_long is set, skip execution of the test.
- if [target_info exists no_long_long] then {
- if [expr [search_for $src "integer\*8"]] then {
- untested "$testcase execution, $option"
- continue
- }
- }
-
- if [info exists torture_execute_xfail] {
- setup_xfail $torture_execute_xfail
- }
-
- set result [objc_load "$executable" "" ""]
- set status [lindex $result 0];
- set output [lindex $result 1];
- if { $status == "pass" } {
- remote_file build delete $executable
- }
- $status "$testcase execution, $option"
- }
-}
-
-#
-# search_for -- looks for a string match in a file
-#
-proc search_for { file pattern } {
- set fd [open $file r]
- while { [gets $fd cur_line]>=0 } {
- set lower [string tolower $cur_line]
- if [regexp "$pattern" $lower] then {
- close $fd
- return 1
- }
- }
- close $fd
- return 0
-}
-
-#
-# objc-torture -- the objc-torture testcase source file processor
-#
-# This runs compilation only tests (no execute tests).
-# SRC is the full pathname of the testcase, or just a file name in which case
-# we prepend $srcdir/$subdir.
-#
-# If the testcase has an associated .cexp file, we source that to run the
-# test instead. We use .cexp instead of .exp so that the testcase is still
-# controlled by the main .exp driver (this is useful when one wants to only
-# 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 objc-torture { args } {
- global srcdir subdir
-
- set src [lindex $args 0];
- if { [llength $args] > 1 } {
- set options [lindex $args 1];
- } else {
- set options ""
- }
-
- # Prepend $srdir/$subdir if missing.
- if ![string match "*/*" $src] {
- set src "$srcdir/$subdir/$src"
- }
-
- # Check for alternate driver.
- if [file exists [file rootname $src].cexp] {
- verbose "Using alternate driver [file rootname [file tail $src]].cexp" 2
- set done_p 0
- catch "set done_p \[source [file rootname $src].cexp\]"
- if { $done_p } {
- return
- }
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $src "do *\[0-9\]"]+[search_for $src "end *do"]] then {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- # loop through all the options
- foreach option $option_list {
- # torture_compile_xfail is set by the .cexp script (if present)
- if [info exists torture_compile_xfail] {
- setup_xfail $torture_compile_xfail
- }
-
- objc-torture-compile $src "$option $options"
- }
-}
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
deleted file mode 100755
index d67ef04..0000000
--- a/gcc/testsuite/lib/objc.exp
+++ /dev/null
@@ -1,269 +0,0 @@
-# Copyright (C) 1992, 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# This file was written by Rob Savoye (rob@cygnus.com)
-# Currently maintained by Doug Evans (dje@cygnus.com)
-
-# This file is loaded by the tool init file (eg: unix.exp). It provides
-# default definitions for objc_start, etc. and other supporting cast members.
-
-# These globals are used by objc_start if no compiler arguments are provided.
-# They are also used by the various testsuites to define the environment:
-# where to find stdio.h, libc.a, etc.
-
-#
-# OBJC_UNDER_TEST is the compiler under test.
-#
-
-#
-# default_objc_version -- extract and print the version number of the compiler
-#
-
-proc default_objc_version { } {
- global OBJC_UNDER_TEST
-
- objc_init;
-
- # ignore any arguments after the command
- set compiler [lindex $OBJC_UNDER_TEST 0]
-
- if ![is_remote host] {
- set compiler_name [which $compiler];
- } else {
- set compiler_name $compiler;
- }
-
- # verify that the compiler exists
- if { $compiler_name != 0 } then {
- set tmp [remote_exec host "$compiler -v"]
- set status [lindex $tmp 0];
- set output [lindex $tmp 1];
- regexp "version.*$" $output version
- if { $status == 0 && [info exists version] } then {
- clone_output "$compiler_name $version\n"
- } else {
- clone_output "Couldn't determine version of $compiler_name: $output\n"
- }
- } else {
- # compiler does not exist (this should have already been detected)
- warning "$compiler does not exist"
- }
-}
-
-#
-# Call objc_version. We do it this way so we can override it if needed.
-#
-proc objc_version { } {
- default_objc_version;
-}
-
-#
-# objc_init -- called at the start of each .exp script.
-#
-# There currently isn't much to do, but always using it allows us to
-# make some enhancements without having to go back and rewrite the scripts.
-#
-
-set objc_initialized 0
-
-proc objc_init { args } {
- global tmpdir
- global libdir
- global gluefile wrap_flags
- global objc_initialized
- global OBJC_UNDER_TEST
- global TOOL_EXECUTABLE
-
- if { $objc_initialized == 1 } { return; }
-
- if ![info exists OBJC_UNDER_TEST] then {
- if [info exists TOOL_EXECUTABLE] {
- set OBJC_UNDER_TEST $TOOL_EXECUTABLE;
- } else {
- set OBJC_UNDER_TEST [find_gcc]
- }
- }
-
- if ![info exists tmpdir] then {
- set tmpdir /tmp
- }
- if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
- set gluefile ${tmpdir}/testglue.o;
- set result [build_wrapper $gluefile];
- if { $result != "" } {
- set gluefile [lindex $result 0];
- set wrap_flags [lindex $result 1];
- } else {
- unset gluefile
- }
- }
-}
-
-proc objc_target_compile { source dest type options } {
- global tmpdir;
- global gluefile wrap_flags;
- global OBJC_UNDER_TEST
- global TOOL_OPTIONS
-
- lappend options "libs=-lobjc"
- if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=$wrap_flags"
- }
-
- if [target_info exists objc,stack_size] {
- lappend options "additional_flags=-DSTACK_SIZE=[target_info objc,stack_size]"
- }
- if [target_info exists objc,no_trampolines] {
- lappend options "additional_flags=-DNO_TRAMPOLINES"
- }
- if [target_info exists objc,no_label_values] {
- lappend options "additional_flags=-DNO_LABEL_VALUES"
- }
- if [info exists TOOL_OPTIONS] {
- lappend options "additional_flags=$TOOL_OPTIONS"
- }
- if [target_info exists objc,no_varargs] {
- lappend options "additional_flags=-DNO_VARARGS"
- }
- set objcpath "[get_multilibs]"
- set libobjc_dir [lookfor_file ${objcpath} libobjc/libobjc.a]
- if { $libobjc_dir != "" } {
- set objc_link_flags "-L[file dirname ${libobjc_dir}]"
- lappend options "additional_flags=${objc_link_flags}"
- }
- lappend options "compiler=$OBJC_UNDER_TEST"
- return [target_compile $source $dest $type $options]
-}
-
-#
-# objc_pass -- utility to record a testcase passed
-#
-
-proc objc_pass { testcase cflags } {
- if { "$cflags" == "" } {
- pass "$testcase"
- } else {
- pass "$testcase, $cflags"
- }
-}
-
-#
-# objc_fail -- utility to record a testcase failed
-#
-
-proc objc_fail { testcase cflags } {
- if { "$cflags" == "" } {
- fail "$testcase"
- } else {
- fail "$testcase, $cflags"
- }
-}
-
-#
-# objc_finish -- called at the end of every .exp script that calls objc_init
-#
-# The purpose of this proc is to hide all quirks of the testing environment
-# from the testsuites. It also exists to undo anything that objc_init did
-# (that needs undoing).
-#
-
-proc objc_finish { } {
- # The testing harness apparently requires this.
- global errorInfo;
-
- if [info exists errorInfo] then {
- unset errorInfo
- }
-
- # Might as well reset these (keeps our caller from wondering whether
- # s/he has to or not).
- global prms_id bug_id
- set prms_id 0
- set bug_id 0
-}
-
-proc objc_exit { } {
- global gluefile;
-
- if [info exists gluefile] {
- file_on_build delete $gluefile;
- unset gluefile;
- }
-}
-
-# If this is an older version of dejagnu (without runtest_file_p),
-# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c.
-# This can be deleted after next dejagnu release.
-
-if { [info procs runtest_file_p] == "" } then {
- proc runtest_file_p { runtests testcase } {
- if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then {
- if { [lsearch $runtests [file tail $testcase]] >= 0 } then {
- return 1
- } else {
- return 0
- }
- }
- return 1
- }
-}
-
-# Provide a definition of this if missing (delete after next dejagnu release).
-
-if { [info procs prune_warnings] == "" } then {
- proc prune_warnings { text } {
- return $text
- }
-}
-
-# Utility used by mike-gcc.exp and c-torture.exp.
-# Check the compiler(/assembler/linker) output for text indicating that
-# the testcase should be marked as "unsupported".
-#
-# When dealing with a large number of tests, it's difficult to weed out the
-# ones that are too big for a particular cpu (eg: 16 bit with a small amount
-# of memory). There are various ways to deal with this. Here's one.
-# Fortunately, all of the cases where this is likely to happen will be using
-# gld so we can tell what the error text will look like.
-
-proc ${tool}_check_unsupported_p { output } {
- if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
- return "memory full"
- }
- return ""
-}
-
-# Prune messages from objc that aren't useful.
-
-proc prune_objc_output { text } {
- #send_user "Before:$text\n"
- regsub -all "(^|\n)\[^\n\]*: In (function|method) \[^\n\]*" $text "" text
- regsub -all "(^|\n)\[^\n\]*: At top level:\[^\n\]*" $text "" text
-
- # It would be nice to avoid passing anything to objc that would cause it to
- # issue these messages (since ignoring them seems like a hack on our part),
- # but that's too difficult in the general case. For example, sometimes
- # you need to use -B to point objc at crt0.o, but there are some targets
- # that don't have crt0.o.
- regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $text "" text
- regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $text "" text
-
- #send_user "After:$text\n"
-
- return $text
-}
-