* [PATCH] testsuite: Improve check-function-bodies
@ 2024-05-31 15:37 Wilco Dijkstra
2024-05-31 16:08 ` Richard Sandiford
0 siblings, 1 reply; 3+ messages in thread
From: Wilco Dijkstra @ 2024-05-31 15:37 UTC (permalink / raw)
To: GCC Patches; +Cc: Richard Sandiford
Improve check-function-bodies by allowing single-character function names.
Also skip '#' comments which may be emitted from inline assembler.
Passes regress, OK for commit?
gcc/testsuite:
* lib/scanasm.exp (configure_check-function-bodies): Allow single-char
function names. Skip '#' comments.
---
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 6cf9997240deec274a191103d21690d80e34ba95..0e461ef260b7a6fee5a9c60d0571e46468f752c0 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -869,15 +869,15 @@ proc configure_check-function-bodies { config } {
# Regexp for the start of a function definition (name in \1).
if { [istarget nvptx*-*-*] } {
set up_config(start) {
- {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S+)$}
+ {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S*)$}
}
} elseif { [istarget *-*-darwin*] } {
set up_config(start) {
- {^_([a-zA-Z_]\S+):$}
+ {^_([a-zA-Z_]\S*):$}
{^LFB[0-9]+:}
}
} else {
- set up_config(start) {{^([a-zA-Z_]\S+):$}}
+ set up_config(start) {{^([a-zA-Z_]\S*):$}}
}
# Regexp for the end of a function definition.
@@ -899,9 +899,9 @@ proc configure_check-function-bodies { config } {
} else {
# Skip lines beginning with labels ('.L[...]:') or other directives
# ('.align', '.cfi_startproc', '.quad [...]', '.text', etc.), '//' or
- # '@' comments ('-fverbose-asm' or ARM-style, for example), or empty
- # lines.
- set up_config(fluff) {^\s*(?:\.|//|@|$)}
+ # '@' or '#' comments ('-fverbose-asm' or ARM-style, for example), or
+ # empty lines.
+ set up_config(fluff) {^\s*(?:\.|//|@|#|$)}
}
# Regexp for expected output lines prefix.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] testsuite: Improve check-function-bodies
2024-05-31 15:37 [PATCH] testsuite: Improve check-function-bodies Wilco Dijkstra
@ 2024-05-31 16:08 ` Richard Sandiford
2024-06-05 14:48 ` Andrew Pinski
0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2024-05-31 16:08 UTC (permalink / raw)
To: Wilco Dijkstra; +Cc: GCC Patches
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:
> Improve check-function-bodies by allowing single-character function names.
> Also skip '#' comments which may be emitted from inline assembler.
>
> Passes regress, OK for commit?
>
> gcc/testsuite:
> * lib/scanasm.exp (configure_check-function-bodies): Allow single-char
> function names. Skip '#' comments.
>
> ---
>
> diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
> index 6cf9997240deec274a191103d21690d80e34ba95..0e461ef260b7a6fee5a9c60d0571e46468f752c0 100644
> --- a/gcc/testsuite/lib/scanasm.exp
> +++ b/gcc/testsuite/lib/scanasm.exp
> @@ -869,15 +869,15 @@ proc configure_check-function-bodies { config } {
> # Regexp for the start of a function definition (name in \1).
> if { [istarget nvptx*-*-*] } {
> set up_config(start) {
> - {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S+)$}
> + {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S*)$}
> }
> } elseif { [istarget *-*-darwin*] } {
> set up_config(start) {
> - {^_([a-zA-Z_]\S+):$}
> + {^_([a-zA-Z_]\S*):$}
> {^LFB[0-9]+:}
> }
> } else {
> - set up_config(start) {{^([a-zA-Z_]\S+):$}}
> + set up_config(start) {{^([a-zA-Z_]\S*):$}}
> }
>
> # Regexp for the end of a function definition.
This part is ok, thanks.
> @@ -899,9 +899,9 @@ proc configure_check-function-bodies { config } {
> } else {
> # Skip lines beginning with labels ('.L[...]:') or other directives
> # ('.align', '.cfi_startproc', '.quad [...]', '.text', etc.), '//' or
> - # '@' comments ('-fverbose-asm' or ARM-style, for example), or empty
> - # lines.
> - set up_config(fluff) {^\s*(?:\.|//|@|$)}
> + # '@' or '#' comments ('-fverbose-asm' or ARM-style, for example), or
> + # empty lines.
> + set up_config(fluff) {^\s*(?:\.|//|@|#|$)}
> }
>
> # Regexp for expected output lines prefix.
I think this should be done separately. It looks like at least
gcc.target/riscv/target-attr-06.c relies on the current behaviour.
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] testsuite: Improve check-function-bodies
2024-05-31 16:08 ` Richard Sandiford
@ 2024-06-05 14:48 ` Andrew Pinski
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2024-06-05 14:48 UTC (permalink / raw)
To: Wilco Dijkstra, GCC Patches, richard.sandiford
On Fri, May 31, 2024 at 9:09 AM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:
> > Improve check-function-bodies by allowing single-character function names.
> > Also skip '#' comments which may be emitted from inline assembler.
> >
> > Passes regress, OK for commit?
> >
> > gcc/testsuite:
> > * lib/scanasm.exp (configure_check-function-bodies): Allow single-char
> > function names. Skip '#' comments.
> >
> > ---
> >
> > diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
> > index 6cf9997240deec274a191103d21690d80e34ba95..0e461ef260b7a6fee5a9c60d0571e46468f752c0 100644
> > --- a/gcc/testsuite/lib/scanasm.exp
> > +++ b/gcc/testsuite/lib/scanasm.exp
> > @@ -869,15 +869,15 @@ proc configure_check-function-bodies { config } {
> > # Regexp for the start of a function definition (name in \1).
> > if { [istarget nvptx*-*-*] } {
> > set up_config(start) {
> > - {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S+)$}
> > + {^// BEGIN(?: GLOBAL|) FUNCTION DEF: ([a-zA-Z_]\S*)$}
> > }
> > } elseif { [istarget *-*-darwin*] } {
> > set up_config(start) {
> > - {^_([a-zA-Z_]\S+):$}
> > + {^_([a-zA-Z_]\S*):$}
> > {^LFB[0-9]+:}
> > }
> > } else {
> > - set up_config(start) {{^([a-zA-Z_]\S+):$}}
> > + set up_config(start) {{^([a-zA-Z_]\S*):$}}
> > }
> >
> > # Regexp for the end of a function definition.
>
> This part is ok, thanks.
Note the issue with single function names was recorded as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111658 (which I just
closed as fixed).
Thanks,
Andrew Pinski
>
> > @@ -899,9 +899,9 @@ proc configure_check-function-bodies { config } {
> > } else {
> > # Skip lines beginning with labels ('.L[...]:') or other directives
> > # ('.align', '.cfi_startproc', '.quad [...]', '.text', etc.), '//' or
> > - # '@' comments ('-fverbose-asm' or ARM-style, for example), or empty
> > - # lines.
> > - set up_config(fluff) {^\s*(?:\.|//|@|$)}
> > + # '@' or '#' comments ('-fverbose-asm' or ARM-style, for example), or
> > + # empty lines.
> > + set up_config(fluff) {^\s*(?:\.|//|@|#|$)}
> > }
> >
> > # Regexp for expected output lines prefix.
>
> I think this should be done separately. It looks like at least
> gcc.target/riscv/target-attr-06.c relies on the current behaviour.
>
> Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-05 14:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-31 15:37 [PATCH] testsuite: Improve check-function-bodies Wilco Dijkstra
2024-05-31 16:08 ` Richard Sandiford
2024-06-05 14:48 ` Andrew Pinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).