From: Rainer Orth Date: Wed, 29 Nov 2023 09:54:22 +0000 (+0100) Subject: testsuite: Adjust g++.dg/opt/devirt2.C on SPARC X-Git-Tag: basepoints/gcc-15~4178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82b6ddb7288a6254d85a43e1febdcca3d176330;p=thirdparty%2Fgcc.git testsuite: Adjust g++.dg/opt/devirt2.C on SPARC Since 20231124, g++.dg/opt/devirt2.C began to FAIL on 32 and 64-bit Solaris/SPARC: FAIL: g++.dg/opt/devirt2.C -std=gnu++14 scan-assembler-times (jmp|call)[^\\n]*xyzzy 4 FAIL: g++.dg/opt/devirt2.C -std=gnu++17 scan-assembler-times (jmp|call)[^\\n]*xyzzy 4 FAIL: g++.dg/opt/devirt2.C -std=gnu++20 scan-assembler-times (jmp|call)[^\\n]*xyzzy 4 FAIL: g++.dg/opt/devirt2.C -std=gnu++98 scan-assembler-times (jmp|call)[^\\n]*xyzzy 4 This is no doubt due to commit ba0869323e1d45b1328b4cb723cb139a2e2146c3 Author: Maciej W. Rozycki Date: Thu Nov 23 16:13:59 2023 +0000 testsuite: Fix subexpressions with `scan-assembler-times' which fixes exactly the double-counting the test relied on/worked around on sparc. Fixed by adjusting the count. Tested on sparc-sun-solaris2.11. 2023-11-28 Rainer Orth gcc/testsuite: * g++.dg/opt/devirt2.C: Adjust scan-assembler-count on sparc for removal of -inline from regexp. Update comment. --- diff --git a/gcc/testsuite/g++.dg/opt/devirt2.C b/gcc/testsuite/g++.dg/opt/devirt2.C index cf4842bd4df3..d71bdaa41f6c 100644 --- a/gcc/testsuite/g++.dg/opt/devirt2.C +++ b/gcc/testsuite/g++.dg/opt/devirt2.C @@ -17,9 +17,7 @@ // { dg-final { scan-assembler-times "jsr\[^\n\]*xyzzy" 2 { target alpha*-*-* } } } // Unless the assembler supports -relax, the 32-bit SPARC compiler generates // sethi/jmp instead of just call, so the scans need to be more specific. -// With subexpressions, Tcl regexp -inline -all returns both the complete -// match and the subexpressions, so double the count. -// { dg-final { scan-assembler-times "\(jmp|call\)\[^\n\]*xyzzy" 4 { target sparc*-*-* } } } +// { dg-final { scan-assembler-times "\(jmp|call\)\[^\n\]*xyzzy" 2 { target sparc*-*-* } } } struct S { S(); virtual void xyzzy(); }; struct R { int a; S s; R(); };