From: Rainer Orth Date: Wed, 17 Dec 2025 12:15:12 +0000 (+0100) Subject: testsuite: diagnostics: Fix gcc.dg/plugin/crash-test-nested-write-through-null.c... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9c1c002e32e937778b1a81f0259849879473a2e;p=thirdparty%2Fgcc.git testsuite: diagnostics: Fix gcc.dg/plugin/crash-test-nested-write-through-null.c etc. on Solaris Two diagnosics tests currently FAIL on Solaris: FAIL: gcc.dg/plugin/crash-test-nested-write-through-null.c crash-test-nested-write-through-null-sarif.py::test_notificatio FAIL: gcc.dg/plugin/crash-test-nested-write-through-null.c crash-test-nested-write-through-null-html.py::test_result The reason is the same in both cases: the tests expect a Segmentation fault message, while the capitalization is different on Solaris: Segmentation Fault This patch allows for both forms, adjusting crash-test-write-through-null-stderr.c in a similar way. Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu. 2025-12-15 Rainer Orth gcc/testsuite: * gcc.dg/plugin/crash-test-nested-write-through-null-html.py: Import re. (test_results): Allow for "Segmentation Fault", too. * gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py: Likewise. * gcc.dg/plugin/crash-test-write-through-null-stderr.c (test_inject_write_through_null): Likewise. --- diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-html.py b/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-html.py index cc76baaeab0..0255b5e5695 100644 --- a/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-html.py +++ b/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-html.py @@ -1,6 +1,7 @@ from htmltest import * import pytest +import re @pytest.fixture(scope='function', autouse=True) def html_tree(): @@ -39,4 +40,4 @@ def test_results(html_tree): assert ice is not None ice_msg = ice.find("./xhtml:div[@class='gcc-message']", ns) assert ice_msg is not None - assert ice_msg.text == "Segmentation fault" + assert re.match("Segmentation [Ff]ault", ice_msg.text) diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py b/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py index d97e4b94cea..9c096fccc78 100644 --- a/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py +++ b/gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py @@ -1,6 +1,7 @@ from sarif import * import pytest +import re @pytest.fixture(scope='function', autouse=True) def sarif(): @@ -32,7 +33,7 @@ def test_notification(sarif): notification = notifications[0] - assert notification['message']['text'] == "Segmentation fault" + assert re.match("Segmentation [Ff]ault", notification['message']['text']) assert notification['level'] == 'error' loc0 = notification['locations'][0] diff --git a/gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c b/gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c index a9a211a3b1f..c6341e5f1bd 100644 --- a/gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c +++ b/gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c @@ -5,6 +5,6 @@ extern void inject_write_through_null (void); void test_inject_write_through_null (void) { - inject_write_through_null (); /* { dg-ice "Segmentation fault" } */ + inject_write_through_null (); /* { dg-ice {Segmentation [Ff]ault} } */ /* { dg-regexp "during GIMPLE pass: crash_test" } */ }