From: Christophe Lyon Date: Thu, 9 Apr 2020 13:56:44 +0000 (+0000) Subject: [testsuite] scanasm.exp: Fix target-selector handling in check-function-bodies X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93674a72309f986c9ace2d6060916053a00da2a1;p=gcc.git [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 * lib/scanasm.exp (check-function-bodies): Use non-greedy regexp when extracting the target selector. --- 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 + + * lib/scanasm.exp (check-function-bodies): Use non-greedy regexp + when extracting the target selector. + 2020-04-09 Martin Jambor 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 {