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.

Ok for trunk?

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2025-12-15  Rainer Orth  <[email protected]>

        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.

# HG changeset patch
# Parent  5101c5b4e879dc6595388a5e49c451bb5b3759d6
testsuite: diagnostics: Fix gcc.dg/plugin/crash-test-nested-write-through-null.c on Solaris

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
--- 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
--- 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
--- 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 (v
 
 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" } */
 }

Reply via email to