This test fails on Solaris 2 when compiled as C++:
FAIL: c-c++-common/tm/malloc.c -std=gnu++98 scan-tree-dump-times tmmark "
malloc .666" 1
FAIL: c-c++-common/tm/malloc.c -std=gnu++11 scan-tree-dump-times tmmark "
malloc .666" 1
It scans for ' malloc', but the Solaris 2 headers are C++aware and
declare std::malloc, which also appears in the dump.
Fixed like this, bootstrapped on i386-pc-solaris2.11 and
x86_64-unknown-linux-gnu, installed on mainline.
Rainer
2011-11-20 Rainer Orth <[email protected]>
* c-c++-common/tm/malloc.c: Scan tree dumps for std::malloc if
*-*-solaris2* && c++.
# HG changeset patch
# Parent 14645d49968bcb44c9bae98bd2df933fc3253b3c
Adapt c-c++-common/tm/malloc.c for Solaris headers with C++
diff --git a/gcc/testsuite/c-c++-common/tm/malloc.c b/gcc/testsuite/c-c++-common/tm/malloc.c
--- a/gcc/testsuite/c-c++-common/tm/malloc.c
+++ b/gcc/testsuite/c-c++-common/tm/malloc.c
@@ -17,7 +17,9 @@ void foobar(void)
z = (char *)malloc (666);
}
-/* { dg-final { scan-tree-dump-times " malloc .666" 1 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times " malloc .666" 1 "tmmark" { target { ! { *-*-solaris2* && c++ } } } } } */
+/* Solaris 2 headers are C++-aware and declare std::malloc. */
+/* { dg-final { scan-tree-dump-times " std::malloc .666" 1 "tmmark" { target { *-*-solaris2* && c++ } } } } */
/* { dg-final { scan-tree-dump-times "__builtin__ITM_malloc" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "__builtin__ITM_calloc" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "__builtin__ITM_free" 2 "tmmark" } } */
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University