diff mbox series

[Committed] Fix fatal typo in gcc.dg/no_profile_instrument_function-attr-2.c

Message ID 20210907204154.9F4CB203AE@pchp3.se.axis.com
State New
Headers show
Series [Committed] Fix fatal typo in gcc.dg/no_profile_instrument_function-attr-2.c | expand

Commit Message

Hans-Peter Nilsson Sept. 7, 2021, 8:41 p.m. UTC
(Committed as obvious.)

Dejagnu is unfortunately brittle: a syntax error in a
directive can abort the test-run for the current "tool"
(gcc, g++, gfortran), and if you don't check for this
condition or actually read the stdout log yourself, your
tools may make you believe the test was successful without
regressions.  At the very least, always grep for ^ERROR: in
the stdout log!

With r12-3379, the testsuite got such a fatal syntax error,
causing the gcc test-run to abort at (e.g.):

...
FAIL: gcc.dg/memchr.c (test for excess errors)
FAIL: gcc.dg/memcmp-3.c (test for excess errors)
ERROR: (DejaGnu) proc "scan-tree-dump-not\" = foo {\(\)"} optimized" does not exist.
The error code is TCL LOOKUP COMMAND scan-tree-dump-not\"
The info on the error is:
invalid command name "scan-tree-dump-not""
    while executing
"::tcl_unknown scan-tree-dump-not\" = foo {\(\)"} optimized"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 ::tcl_unknown $args"

		=== gcc Summary ===

# of expected passes		63740
# of unexpected failures	38
# of unexpected successes	2
# of expected failures		351
# of unresolved testcases	3
# of unsupported tests		662
x/cris-elf/gccobj/gcc/xgcc  version 12.0.0 20210907 (experimental)\
 [master r12-3391-g849d5f5929fc] (GCC)

testsuite:
	* gcc.dg/no_profile_instrument_function-attr-2.c: Fix
	typo in last change.
---
 gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Liška Sept. 8, 2021, 7:29 a.m. UTC | #1
On 9/7/21 22:41, Hans-Peter Nilsson wrote:
> With r12-3379, the testsuite got such a fatal syntax error,
> causing the gcc test-run to abort at (e.g.):

Thank you for the fix! I haven't noticed the problem as I only grep for '^FAIL'
lines in the corresponding log files.

Cheers,
Martin
Hans-Peter Nilsson Sept. 8, 2021, 11:25 a.m. UTC | #2
> From: Martin Liaka <mliska@suse.cz>
> Date: Wed, 8 Sep 2021 09:29:52 +0200

> On 9/7/21 22:41, Hans-Peter Nilsson wrote:
> > With r12-3379, the testsuite got such a fatal syntax error,
> > causing the gcc test-run to abort at (e.g.):
> 
> Thank you for the fix! I haven't noticed the problem as I only grep for '^FAIL'
> lines in the corresponding log files.

You're welcome but *please* also add (conceptually)
"grep -q ^ERROR: makelog && fail" to your workflow.

brgds, H-P
PS. yeah, but worth repeating
Rainer Orth Sept. 8, 2021, 11:31 a.m. UTC | #3
Hi Hans-Peter,

>> From: Martin Liaka <mliska@suse.cz>
>> Date: Wed, 8 Sep 2021 09:29:52 +0200
>
>> On 9/7/21 22:41, Hans-Peter Nilsson wrote:
>> > With r12-3379, the testsuite got such a fatal syntax error,
>> > causing the gcc test-run to abort at (e.g.):
>> 
>> Thank you for the fix! I haven't noticed the problem as I only grep for '^FAIL'
>> lines in the corresponding log files.
>
> You're welcome but *please* also add (conceptually)
> "grep -q ^ERROR: makelog && fail" to your workflow.

even that is not enough, though: one also needs to look for UNRESOLVED
and XPASS.  An easy way of doing all this is running make
mail-report.log after the build and comparing the output to an
unmodified build.  Saves everyone loads of trouble.

	Rainer
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-2.c b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-2.c
index 472eca88efdd..2e93ee5f6891 100644
--- a/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-2.c
+++ b/gcc/testsuite/gcc.dg/no_profile_instrument_function-attr-2.c
@@ -12,4 +12,4 @@  int bar()
   return foo();
 }
 
-/* { dg-final { scan-tree-dump-not" = foo \\(\\)" "optimized"} } */
+/* { dg-final { scan-tree-dump-not " = foo \\(\\)" "optimized"} } */