]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++-v3: testsuite: Prune uncapitalized "in function" linker warning
authorHans-Peter Nilsson <hp@axis.com>
Wed, 14 Aug 2024 02:38:05 +0000 (04:38 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Fri, 16 Aug 2024 01:06:53 +0000 (03:06 +0200)
Newer newlib trigger warnings about certain functions not implemented
(_getentropy) when testing libstdc++-v3.

Since 2018 (circa binutils-2.31) the "in function" prefix isn't
capitalized for those "not implemented" warnings when generated from
the linker (a GNU ld feature used by newlib).  Dejagnu up to and
including at least dejagnu-1.6.3 (and git @ 42979bd3b9) assumes a
capital "In function", leaving that part unpruned, and boom we have
thousands of "excess errors" from the libstdc++-v3 testsuite.

While gcc/testsuite/lib/prune.exp:prune_gcc_output already deals with
this quirk with a vastly more generic pattern, I choose this simpler
tweak.

libstdc++-v3:
* testsuite/lib/prune.exp (libstdc++-dg-prune): Prune
uncapitalized "in function" warning from linker.

libstdc++-v3/testsuite/lib/prune.exp

index 071dcf34c1e8f841ea2e01b9281abc99b8654ffc..4250e2d39e7d53d6139240131d7a38b9d5b7d99b 100644 (file)
@@ -80,6 +80,15 @@ proc libstdc++-dg-prune { system text } {
     # Ignore dsymutil warning (tool bug is actually in the linker)
     regsub -all "(^|\n)\[^\n\]*could not find object file symbol for symbol\[^\n\]*" $text "" text
 
+    # This pattern, except requiring a capitalized "In" and with a
+    # sub-pattern matching a subsequent line "is not implemented and will
+    # always fail", is part of the standard dejagnu prune_warnings function.
+    # There's also a separate single-line pattern pruning the "is not
+    # implemented and will always fail".  Since that pattern is processed
+    # before this ${tool}-dg-prune function is called, we have to handle
+    # the single uncapitalized "in function" line.
+    regsub -all "(^|\n)\[^\n\]*: in function\[^\n\]*" $text "" text
+
     # If exceptions are disabled, mark tests expecting exceptions to be enabled
     # as unsupported.
     if { ![check_effective_target_exceptions_enabled] } {