]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Be more informative for ICEs
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 10 Dec 2021 18:08:26 +0000 (19:08 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Wed, 15 Dec 2021 22:26:26 +0000 (23:26 +0100)
For example, for the two (FAIL, XFAIL)
'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-test-1' cases:

    -FAIL: g++.dg/modules/xtreme-header-3_a.H -std=c++17 (internal compiler error)
    +FAIL: g++.dg/modules/xtreme-header-3_a.H -std=c++17 (internal compiler error: tree check: expected var_decl or function_decl or field_decl or type_decl or concept_decl or template_decl, have namespace_decl in get_merge_kind, at cp/module.cc:10072)

    -FAIL: gfortran.dg/gomp/clauses-1.f90   -O  (internal compiler error)
    +FAIL: gfortran.dg/gomp/clauses-1.f90   -O  (internal compiler error: Segmentation fault)

    -XFAIL: c-c++-common/goacc/kernels-decompose-ice-1.c (internal compiler error)
    +XFAIL: c-c++-common/goacc/kernels-decompose-ice-1.c (internal compiler error: in lower_omp_target, at omp-low.c:13147)

    -XFAIL: g++.dg/cpp1z/constexpr-lambda26.C  -std=c++17 (internal compiler error)
    +XFAIL: g++.dg/cpp1z/constexpr-lambda26.C  -std=c++17 (internal compiler error: in cxx_eval_constant_expression, at cp/constexpr.c:6954)

That allows for more easily spotting when during development you're trading one
ICE for another.

gcc/testsuite/
* lib/fortran-torture.exp (fortran-torture-compile)
(fortran-torture-execute): Be more informative for ICEs.
* lib/gcc-defs.exp (${tool}_check_compile): Likewise.
* lib/gcc-dg.exp (gcc-dg-test-1): Likewise.
* lib/go-torture.exp (go-torture-compile, go-torture-execute):
Likewise.

gcc/testsuite/lib/fortran-torture.exp
gcc/testsuite/lib/gcc-defs.exp
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/go-torture.exp

index d6759aa0b4bd7c2a71a426f431b92fed8e0d922a..11d73d9f1f7c7272e6cab072b9176b8756be3a5e 100644 (file)
@@ -138,8 +138,8 @@ proc fortran-torture-compile { src option } {
        return
     }
 
-    if [string match "*internal compiler error*" $comp_output] then {
-       gfortran_fail $testcase "$option (internal compiler error)"
+    if [regexp -line -- "internal compiler error.*" $comp_output ice] then {
+       gfortran_fail $testcase "$option ($ice)"
        catch { remote_file build delete $output }
        return
     }
@@ -263,8 +263,8 @@ proc fortran-torture-execute { src } {
            continue
        }
 
-       if [string match "*internal compiler error*" $comp_output] then {
-           gfortran_fail $testcase "$option (internal compiler error)"
+       if [regexp -line -- "internal compiler error.*" $comp_output ice] then {
+           gfortran_fail $testcase "$option ($ice)"
            catch { remote_file build delete $executable }
            continue
        }
index d17308d0f8674330ba2726dcedd5afe47dbefcb6..66df4e1c6aa27d04d684f7ef60bffad0c6bad83e 100644 (file)
@@ -38,8 +38,8 @@ proc ${tool}_check_compile {testcase option objname gcc_output} {
        return 0
     }
 
-    if [string match "*internal compiler error*" $gcc_output] then {
-       ${tool}_fail $testcase "$option (internal compiler error)"
+    if [regexp -line -- "internal compiler error.*" $gcc_output ice] then {
+       ${tool}_fail $testcase "$option ($ice)"
        return 0
     }
 
index 78a6c3651efcbfd97f20b2ae31513e8c4d1a2aca..464059608b8e7d21b4b371296014d9ffd5e5a49c 100644 (file)
@@ -315,13 +315,13 @@ proc gcc-dg-test-1 { target_compile prog do_what extra_tool_flags } {
     # to avoid a second failure for excess errors.
     # "Error reporting routines re-entered" ICE says "Internal" rather than
     # "internal", so match that too.
-    if [string match {*[Ii]nternal compiler error*} $comp_output] {
+    if [regexp -line -- {[Ii]nternal compiler error.*} $comp_output ice] {
        upvar 2 name name
        if { $expect_ice == 0 } {
-         fail "$name (internal compiler error)"
+         fail "$name ($ice)"
        } else {
          # We expected an ICE and we got it.
-         xfail "$name (internal compiler error)"
+         xfail "$name ($ice)"
          # Prune the ICE from the output.
          set comp_output [prune_ices $comp_output]
        }
index 28247a1902dd09fc7192951800b55438879e86fa..adeae36f9168b2f7ddbcf05cef27b0ba4cfc9214 100644 (file)
@@ -88,8 +88,8 @@ proc go-torture-compile { src option } {
        return
     }
 
-    if [string match "*internal compiler error*" $comp_output] then {
-       go_fail $testcase "$option (internal compiler error)"
+    if [regexp -line -- "internal compiler error.*" $comp_output ice] then {
+       go_fail $testcase "$option ($ice)"
        catch { remote_file build delete $output }
        return
     }
@@ -224,8 +224,8 @@ proc go-torture-execute { src } {
            continue
        }
 
-       if [string match "*internal compiler error*" $comp_output] then {
-           go_fail $testcase "$option (internal compiler error)"
+       if [regexp -line -- "internal compiler error.*" $comp_output ice] then {
+           go_fail $testcase "$option ($ice)"
            catch { remote_file build delete $executable }
            continue
        }