[testsuite] scanasm.exp: Fix target-selector handling in check-function-bodies
authorChristophe Lyon <christophe.lyon@linaro.org>
Thu, 9 Apr 2020 13:56:44 +0000 (13:56 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Thu, 9 Apr 2020 14:17:48 +0000 (14:17 +0000)
{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.

gcc/testsuite/ChangeLog
gcc/testsuite/lib/scanasm.exp

index e01fdb0fe2c7f0102b72f9c7462f588e4765f30c..e692a7f683811c9e100c9daf8f1ac9cc04bb6fe5 100644 (file)
@@ -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
index 8d2364f93a9b82e3e2a7aac6a0cf4fdd34b8f5fd..d5f2be47d2f7f423011adde68caf579416bdacfc 100644 (file)
@@ -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 {