https://gcc.gnu.org/g:c9c1c002e32e937778b1a81f0259849879473a2e

commit r16-6208-gc9c1c002e32e937778b1a81f0259849879473a2e
Author: Rainer Orth <[email protected]>
Date:   Wed Dec 17 13:15:12 2025 +0100

    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  <[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.

Diff:
---
 .../gcc.dg/plugin/crash-test-nested-write-through-null-html.py         | 3 ++-
 .../gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py        | 3 ++-
 gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c     | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

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 cc76baaeab07..0255b5e5695c 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 d97e4b94cea6..9c096fccc786 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 a9a211a3b1fe..c6341e5f1bd8 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" } */
 }

Reply via email to