This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[LTO] PATCH: allow mixed-language tests


This patch removes the restriction in proc lto-execute that the second
and subsequent source files in a test have the same extension as the
first file.  This allows, for example, test programs to be compiled from
a mixture of Fortran and C source files (eg. PR 40725).

In case of operator error, the test harness will warn if there is more
than one source file that matches <basename>.*.  The harness does not
protect you from using filename extensions that are unrecognised by the
compiler driver.  I figure that will be quickly discovered in the
DejaGnu logs. ;-)

Okay for LTO branch?

2009-07-14  Ben Elliston  <bje@au.ibm.com>

        * lib/lto.exp (lto-execute): Allow second and subsequent source
        files in a test to have any filename extension.

Index: lto.exp
===================================================================
--- lto.exp	(revision 149614)
+++ lto.exp	(working copy)
@@ -314,7 +314,6 @@ proc lto-execute { src1 sid } {
 
     # Set up the names of the other source files.
     set dir [file dirname $src1]
-    set ext [file extension $src1]
     set base [file rootname $src1]
     set base [string range $base [string length $dir] end]
     regsub "_0" $base "" base
@@ -323,9 +322,12 @@ proc lto-execute { src1 sid } {
     set i 1
     set done 0
     while { !$done } {
-	set name "${dir}/${base}_${i}${ext}"
-	if { [file exists ${name}] } {
-	    lappend src_list ${name}
+	set names [glob -nocomplain -types f -- "${dir}/${base}_${i}.*"]
+	if { [llength ${names}] > 1 } {
+	    warning "lto-execute: more than one file matched ${dir}/${base}_${i}.*"
+	}
+	if { [llength ${names}] == 1 } {
+	    lappend src_list [lindex ${names} 0]
 	    incr i
 	} else {
 	    set num_srcs ${i}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]