]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
check-function-bodies: Support "^[0-9]+:"
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 2 Jul 2025 00:51:47 +0000 (08:51 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 7 Jul 2025 20:31:45 +0000 (04:31 +0800)
While working on

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120936

I tried to use check-function-bodies to verify that label for mcount
and __fentry__ is only generated by "-pg" if it is used by __mcount_loc
section:

1: call mcount
.section __mcount_loc, "a",@progbits
.quad 1b
.previous

Add "^[0-9]+:" to check-function-bodies to allow:

1: call mcount

PR testsuite/120881
* lib/scanasm.exp (check-function-bodies): Allow "^[0-9]+:".

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/testsuite/lib/scanasm.exp

index 97935cb23c3cf00338ce72a82a89a06854f9177b..a2311de5704b50d146691330811585cc43c3d97e 100644 (file)
@@ -1109,6 +1109,8 @@ proc check-function-bodies { args } {
                append function_regexp ".*"
            } elseif { [regexp {^\.L} $line] } {
                append function_regexp $line "\n"
+           } elseif { [regexp {^[0-9]+:} $line] } {
+               append function_regexp $line "\n"
            } else {
                append function_regexp $config(line_prefix) $line "\n"
            }