]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: diagnostics: Fix gcc.dg/plugin/crash-test-nested-write-through-null.c...
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 17 Dec 2025 12:15:12 +0000 (13:15 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 17 Dec 2025 12:15:12 +0000 (13:15 +0100)
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  <ro@CeBiTec.Uni-Bielefeld.DE>

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.

gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-html.py
gcc/testsuite/gcc.dg/plugin/crash-test-nested-write-through-null-sarif.py
gcc/testsuite/gcc.dg/plugin/crash-test-write-through-null-stderr.c

index cc76baaeab07a55f00be0aaf44f7e8f66e435774..0255b5e5695c4a75649ac3919e9d9870d82be2c6 100644 (file)
@@ -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)
index d97e4b94cea694a18a02d23e721ab30fcabc6749..9c096fccc786b7fe0db72f7985251ac92156cb0a 100644 (file)
@@ -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]
index a9a211a3b1fea3371914894a02f36706de969583..c6341e5f1bd8e0cc77d12790e2f6016746cb65b5 100644 (file)
@@ -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" } */
 }