diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-02-14 09:25:03 +0100 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2024-02-14 09:25:03 +0100 |
commit | ab0c2c367a87b03f38a486a118b89335837619dc (patch) | |
tree | f7740ec7afa7c1a503a8ac4c2bdcbaf121d337ba | |
parent | 5f2cd521347f47292f5459143514120d6b624693 (diff) | |
download | gcc-ab0c2c367a87b03f38a486a118b89335837619dc.zip gcc-ab0c2c367a87b03f38a486a118b89335837619dc.tar.gz gcc-ab0c2c367a87b03f38a486a118b89335837619dc.tar.bz2 |
testsuite: xfail c-c++-common/pr103798-2.c for C++ on Solaris [PR113706]
c-c++-common/pr103798-2.c FAILs on Solaris when compiled as C++:
FAIL: c-c++-common/pr103798-2.c -std=gnu++14 scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c -std=gnu++17 scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c -std=gnu++20 scan-assembler-not memchr
FAIL: c-c++-common/pr103798-2.c -std=gnu++98 scan-assembler-not memchr
As Jason analyzed, Solaris <string.h> declares memchr for C++ as returning
const void * as specified by the C++ standard, while gcc expects the return
type to be void * like in C.
So this patch xfails the test for C++ on Solaris.
Tested on sparc-sun-solaris2.11 and x86_64-pc-linux-gnu.
2024-02-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
PR c++/113706
* c-c++-common/pr103798-2.c (scan-assembler-not): xfail for C++ on
Solaris.
-rw-r--r-- | gcc/testsuite/c-c++-common/pr103798-2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/pr103798-2.c b/gcc/testsuite/c-c++-common/pr103798-2.c index e7e99c3..bc126c2 100644 --- a/gcc/testsuite/c-c++-common/pr103798-2.c +++ b/gcc/testsuite/c-c++-common/pr103798-2.c @@ -27,4 +27,5 @@ main () return 0; } -/* { dg-final { scan-assembler-not "memchr" } } */ +/* See PR c++/113706 for the xfail. */ +/* { dg-final { scan-assembler-not "memchr" { xfail { c++ && *-*-solaris2* } } } } */ |