> I thought something like that was already done but I couldn't find it
> right now.  Is it a problem?  If so, we should certainly do this.

I see it done in other places, but not scanasm.  How's this?

2008-10-23  DJ Delorie  <[EMAIL PROTECTED]>

        * lib/scanasm.exp: Extract first word of $testcase for all upvar
        uses.

 
 2008-10-09  Thomas Koenig  <[EMAIL PROTECTED]>
Index: lib/scanasm.exp
===================================================================
--- lib/scanasm.exp     (revision 141026)
+++ lib/scanasm.exp     (working copy)
@@ -64,22 +64,24 @@ proc dg-scan { name positive testcase ou
 
 # Look for a pattern in the .s file produced by the compiler.  See
 # dg-scan for details.
 
 proc scan-assembler { args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     dg-scan "scan-assembler" 1 $testcase $output_file $args
 }
 
 # Check that a pattern is not present in the .s file produced by the
 # compiler.  See dg-scan for details.
 
 proc scan-assembler-not { args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     dg-scan "scan-assembler-not" 0 $testcase $output_file $args
 }
 
 # Return the scan for the assembly for hidden visibility. 
@@ -99,12 +101,13 @@ proc hidden-scan-for { symbol } {
 
 # Check that a symbol is defined as a hidden symbol in the .s file
 # produced by the compiler.
 
 proc scan-hidden { args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     set symbol [lindex $args 0]
 
     set hidden_scan [hidden-scan-for $symbol]
 
@@ -115,12 +118,13 @@ proc scan-hidden { args } {
 
 # Check that a symbol is not defined as a hidden symbol in the .s file
 # produced by the compiler.
 
 proc scan-not-hidden { args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     set symbol [lindex $args 0]
     set hidden_scan [hidden-scan-for $symbol]
 
     set args [lreplace $args 0 0 "$hidden_scan"]
@@ -129,20 +133,22 @@ proc scan-not-hidden { args } {
 }
 
 # Look for a pattern in OUTPUT_FILE.  See dg-scan for details.
 
 proc scan-file { output_file args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     dg-scan "scan-file" 1 $testcase $output_file $args
 }
 
 # Check that a pattern is not present in the OUTPUT_FILE.  See dg-scan
 # for details.
 
 proc scan-file-not { output_file args } {
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     dg-scan "scan-file-not" 0 $testcase $output_file $args
 }
 
 # Call pass if pattern is present given number of times, otherwise fail.
 proc scan-assembler-times { args } {
     if { [llength $args] < 2 } {
@@ -163,12 +169,13 @@ proc scan-assembler-times { args } {
     }
 
     # This assumes that we are two frames down from dg-test, and that
     # it still stores the filename of the testcase in a local variable "name".
     # A cleaner solution would require a new dejagnu release.
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
 
     # This must match the rule in gcc-dg.exp.
     set output_file "[file rootname [file tail $testcase]].s"
 
     set fd [open $output_file r]
     set text [read $fd]
@@ -212,12 +219,13 @@ proc scan-assembler-dem { args } {
                      [findfile $base_dir/c++filt $base_dir/c++filt \
                       [transform c++filt]]]]
        verbose -log "c++filt is $cxxfilt"
     }
 
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     set output [remote_exec host "$cxxfilt" "" "$output_file"]
     set text [lindex $output 1]
 
     if [regexp -- [lindex $args 0] $text] {
@@ -257,12 +265,13 @@ proc scan-assembler-dem-not { args } {
                      [findfile $base_dir/c++filt $base_dir/c++filt \
                       [transform c++filt]]]]
        verbose -log "c++filt is $cxxfilt"
     }
 
     upvar 2 name testcase
+    set testcase [lindex $testcase 0]
     set output_file "[file rootname [file tail $testcase]].s"
 
     set output [remote_exec host "$cxxfilt" "" "$output_file"]
     set text [lindex $output 1]
 
     if ![regexp -- [lindex $args 0] $text] {

Reply via email to