[gcc/devel/ranger] [testsuite] scanasm.exp: Fix target-selector handling in check-function-bodies

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 17 20:20:08 GMT 2020


https://gcc.gnu.org/g:93674a72309f986c9ace2d6060916053a00da2a1

commit 93674a72309f986c9ace2d6060916053a00da2a1
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Thu Apr 9 13:56:44 2020 +0000

    [testsuite] scanasm.exp: Fix target-selector handling in check-function-bodies
    
    {target { ! a } } does not work because the greedy regexp extracts
    "! a }" instead of "target { ! a }".
    
    This patch replaces it with a non-greedy regexp.
    
    2020-04-09  Christophe Lyon  <christophe.lyon@linaro.org>
    
            * lib/scanasm.exp (check-function-bodies): Use non-greedy regexp
            when extracting the target selector.

Diff:
---
 gcc/testsuite/ChangeLog       | 5 +++++
 gcc/testsuite/lib/scanasm.exp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e01fdb0fe2c..e692a7f6838 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-09  Christophe Lyon  <christophe.lyon@linaro.org>
+
+	* lib/scanasm.exp (check-function-bodies): Use non-greedy regexp
+	when extracting the target selector.
+
 2020-04-09  Martin Jambor  <mjambor@suse.cz>
 
 	PR tree-optimization/94482
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 8d2364f93a9..d5f2be47d2f 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -689,7 +689,7 @@ proc check-function-bodies { args } {
 	if { [string equal -length $prefix_len $line $prefix] } {
 	    set line [string trim [string range $line $prefix_len end]]
 	    if { !$in_function } {
-		if { [regexp "^(.*\\S)\\s+{(.*)}\$" $line dummy \
+		if { [regexp "^(.*?\\S)\\s+{(.*)}\$" $line dummy \
 			  line selector] } {
 		    set selector [dg-process-target $selector]
 		} else {


More information about the Gcc-cvs mailing list