[RFA] c-torture.exp patch
Ben Elliston
bje@redhat.com
Fri May 24 15:25:00 GMT 2002
The following patch removes a limitation in the C torture test
framework. DejaGnu can process multiple source files in its
default_target_compile procedure, but the c-torture-execute procedure
limits the caller to one source file. This patch corrects this.
Okay to commit?
2002-05-24 Ben Elliston <bje@redhat.com>
* lib/c-torture.exp (c-torture-execute): Handle multiple sources.
Index: c-torture.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/testsuite/lib/c-torture.exp,v
retrieving revision 1.76
diff -u -p -c -r1.76 c-torture.exp
*** c-torture.exp 2001/01/24 20:23:45 1.76
--- c-torture.exp 2002/05/24 21:20:25
*************** proc c-torture-compile { src option } {
*** 91,105 ****
#
# c-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 c-torture-execute { src args } {
global tmpdir tool srcdir output compiler_conditional_xfail_data
if { [llength $args] > 0 } {
set additional_flags [lindex $args 0];
} else {
--- 91,109 ----
#
# c-torture-execute -- utility to compile and execute a testcase
#
! # SOURCES is a list of full pathnames to the test source files.
! # The first filename in this list forms 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 c-torture-execute { sources args } {
global tmpdir tool srcdir output compiler_conditional_xfail_data
+ # Use the first source filename given as the filename under test.
+ set src [lindex $sources 0]
+
if { [llength $args] > 0 } {
set additional_flags [lindex $args 0];
} else {
*************** proc c-torture-execute { src args } {
*** 164,170 ****
if { $additional_flags != "" } {
lappend options "additional_flags=$additional_flags";
}
! set comp_output [gcc_target_compile "$src" "${execname}" executable $options];
if ![gcc_check_compile "$testcase compilation" $option $execname $comp_output] {
unresolved "$testcase execution, $option"
--- 168,174 ----
if { $additional_flags != "" } {
lappend options "additional_flags=$additional_flags";
}
! set comp_output [gcc_target_compile "$sources" "${execname}" executable $options];
if ![gcc_check_compile "$testcase compilation" $option $execname $comp_output] {
unresolved "$testcase execution, $option"
More information about the Gcc-patches
mailing list