The g++.dg/gcov/pr16855*.C tests FAIL on Solaris:
FAIL: g++.dg/gcov/pr16855.C -std=gnu++17 gcov: 1 failures in line counts, 0
in branch percentages, 0 in condition/decision, 0 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters
FAIL: g++.dg/gcov/pr16855.C -std=gnu++17 line 24: is #####:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 gcov: 6 failures in line counts, 0
in branch percentages, 0 in condition/decision, 0 in prime-paths, 0 in return
percentages, 0 in intermediate format, 0 failed in filters
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 15: is 3:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 22: is 3:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 24: is #####:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 38: is 3:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 44: is 3:should be 1
FAIL: g++.dg/gcov/pr16855.C -std=gnu++26 line 49: is 3:should be 1
Same for -std=gnu++98.
The issue has long been known and the failures generate an excessive
amount of noise. Since the PRs haven't seen any activity in years, this
patch xfail's them.
Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11,
x86_64-pc-linux-gnu, and x86_64-apple-darwin25.1.0.
Committed to trunk.
I've tried to fix this myself several times, but never got anywhere, so
this is beyond me.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2025-11-26 Rainer Orth <[email protected]>
gcc/testsuite:
PR c++/81337
PR c++/52477
* g++.dg/gcov/pr16855.C (Test::~Test): xfail on *-*-solaris2*
(dg-final): Likewise.
* g++.dg/gcov/pr16855-priority.C (Test::~Test): Likewise.
(dg-final): Likewise.
# HG changeset patch
# Parent 2c9647adb88ccc19fd423af4960d3cba77bd0e79
testsuite: xfail g++.dg/gcov/pr16855*.C on Solaris [PR52477,PR81337]
diff --git a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
--- a/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
+++ b/gcc/testsuite/g++.dg/gcov/pr16855-priority.C
@@ -20,7 +20,7 @@ class Test
public:
Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
~Test (void) {
- fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* } */
+ fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-dragonfly* *-*-solaris2* } */
}
} T1;
@@ -78,4 +78,4 @@ static void __attribute__ ((destructor (
fprintf (stderr, "in destructor((65535))\n"); /* count(1) */
}
-/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* } } } */
+/* { dg-final { run-gcov branches { -b pr16855-priority.C } { xfail *-*-dragonfly* *-*-solaris2* } } } */
diff --git a/gcc/testsuite/g++.dg/gcov/pr16855.C b/gcc/testsuite/g++.dg/gcov/pr16855.C
--- a/gcc/testsuite/g++.dg/gcov/pr16855.C
+++ b/gcc/testsuite/g++.dg/gcov/pr16855.C
@@ -1,7 +1,8 @@
/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */
-/* See PR91087 for information on Darwin xfails. */
+/* See PR91087 for information on Darwin xfails. Also PR81337 for Solaris
+ ones.*/
#include <stdlib.h>
#include <stdio.h>
@@ -21,7 +22,7 @@ class Test
public:
Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ }
~Test (void) {
- fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* } */
+ fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* *-*-dragonfly* *-*-solaris2* } */
}
} T1;
@@ -49,4 +50,4 @@ static void __attribute__ ((destructor))
fprintf (stderr, "in destructor(())\n"); /* count(1) { xfail *-*-darwin* } */
}
-/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* } } } */
+/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* *-*-dragonfly* *-*-solaris2* } } } */