This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] new g++.exp procs
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] new g++.exp procs
- From: Stan Cox <scox at redhat dot com>
- Date: 23 Jul 2001 17:07:20 -0400
This patch adds support for various procs that are in gcc.exp but not
g++.exp so g++ testsuites can use a harness mechanism that is similar to gcc.
The new procs are:
g++_init
g++_check_compile
g++_pass
g++_fail
g++_check_unsupported_p
Tested on i686-pc-linux-gnu.
2001-07-23 Stan Cox <scox@redhat.com>
* lib/g++.exp (g++_init, g++_check_compile, g++_pass, g++_fail,
g++_check_unsupported_p): New procs
* lib/gcc.exp (gcc_check_unsupported_p): Renamed from
${tool}_check_unsupported_p.
Index: g++.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.71
diff -u -2 -p -r1.71 g++.exp
--- g++.exp 2001/04/30 22:38:07 1.71
+++ g++.exp 2001/07/23 20:13:22
@@ -30,4 +30,6 @@
set gpp_compile_options ""
+ load_lib gcc.exp
+
#
# g++_version -- extract and print the version number of the compiler
@@ -36,4 +38,6 @@ proc g++_version { } {
global GXX_UNDER_TEST
+ g++_init
+
# ignore any arguments after the command
set compiler [lindex $GXX_UNDER_TEST 0]
@@ -60,4 +64,39 @@ proc g++_version { } {
}
+set gxx_initialized 0
+
+proc g++_init { args } {
+ global tmpdir
+ global libdir
+ global gluefile wrap_flags
+ global gxx_initialized
+ global GCC_UNDER_TEST
+ global TOOL_EXECUTABLE
+
+ if { $gxx_initialized == 1 } { return; }
+
+ if ![info exists GXX_UNDER_TEST] {
+ if [info exists TOOL_EXECUTABLE] {
+ set GXX_UNDER_TEST $TOOL_EXECUTABLE;
+ } else {
+ set GXX_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
+ }
+ }
+}
+
#
# provide new versions of g++_include_flags and g++_link_flags (both
@@ -259,4 +298,16 @@ proc g++_target_compile { source dest ty
}
+proc g++_check_compile {testcase option objname gcc_output} {
+ return [gcc_check_compile $testcase $option $objname $gcc_output]
+}
+
+proc g++_pass { testcase cflags } {
+ gcc_pass $testcase $cflags
+}
+
+proc g++_fail { testcase cflags } {
+ gcc_fail $testcase $cflags
+}
+
proc g++_exit { args } {
global gluefile;
@@ -317,9 +368,6 @@ trace variable env(LD_LIBRARY_PATH) w g+
# 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 g++_check_unsupported_p { output } {
+ return [gcc_check_unsupported_p $output]
}
Index: gcc.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/lib/gcc.exp,v
retrieving revision 1.72
diff -u -2 -p -r1.72 gcc.exp
--- gcc.exp 2001/04/30 22:38:07 1.72
+++ gcc.exp 2001/07/23 20:13:22
@@ -294,5 +294,5 @@ if { [info procs prune_warnings] == "" }
# gld so we can tell what the error text will look like.
-proc ${tool}_check_unsupported_p { output } {
+proc gcc_check_unsupported_p { output } {
if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $output] {
return "memory full"