From b4d0b1a7e645712af72a6debc69f796e918169d6 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 29 May 2018 07:08:11 +0000 Subject: [PATCH] [testsuite] Fix error message in scan-hidden/scan-not-hidden 2018-05-29 Tom de Vries * lib/scanasm.exp (scan-hidden, scan-not-hidden): Handle being called with no arguments. From-SVN: r260857 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/scanasm.exp | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e3766bcf4d9..43210ab8248 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-29 Tom de Vries + + * lib/scanasm.exp (scan-hidden, scan-not-hidden): Handle being called + with no arguments. + 2018-05-28 Richard Biener PR tree-optimization/85934 diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 61e0f3f48ae..5c574d550cb 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -125,11 +125,13 @@ proc scan-hidden { args } { set filename [lindex $testcase 0] set output_file "[file rootname [file tail $filename]].s" - set symbol [lindex $args 0] + if { [llength $args] > 0 } { + set symbol [lindex $args 0] - set hidden_scan [hidden-scan-for $symbol] + set hidden_scan [hidden-scan-for $symbol] - set args [lreplace $args 0 0 "$hidden_scan"] + set args [lreplace $args 0 0 "$hidden_scan"] + } dg-scan "scan-hidden" 1 $testcase $output_file $args } @@ -143,10 +145,12 @@ proc scan-not-hidden { args } { set filename [lindex $testcase 0] set output_file "[file rootname [file tail $filename]].s" - set symbol [lindex $args 0] - set hidden_scan [hidden-scan-for $symbol] + if { [llength $args] > 0 } { + set symbol [lindex $args 0] + set hidden_scan [hidden-scan-for $symbol] - set args [lreplace $args 0 0 "$hidden_scan"] + set args [lreplace $args 0 0 "$hidden_scan"] + } dg-scan "scan-not-hidden" 0 $testcase $output_file $args } -- 2.30.2