From patchwork Fri Dec 10 22:42:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 48810 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2881D385781D for ; Fri, 10 Dec 2021 22:42:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 727A6385801D for ; Fri, 10 Dec 2021 22:42:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 727A6385801D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: MaGJQNgcNms4JSmQX6q2aPVpFzaxOmoAGlBjTGz7044GVRnid0cuOzzBzFD/vH/LV+FpU00BEq cEQttLfaUnwX2mXycAVXtp7DbuYk05sYZ4WFrzNCK4DSV/6fe2rhrbXI67MUffqTPw6Gozujre sstJql5/3sF+QsroyLSFSAAhozu8TH+mg/pAdXKFQ5yhIrtxOPZgZC3uKQszL9vrCsS8VAIRNL bSumBnvysGkBlZVv6CspjQ93gUjnpzI0zyXepZ1QdloqXwghyt79LNAT1ztWB4DIq4Wl1DfOg9 iOQo0LjoeIkfBNV/9LeXuHnG X-IronPort-AV: E=Sophos;i="5.88,196,1635235200"; d="scan'208,223";a="72072078" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 10 Dec 2021 14:42:29 -0800 IronPort-SDR: jcFRud6R2vT1ummitEHhQGXeV2sWYVc51QdoTuOVjgkKX7KAhhtvn6HXMnBxaE4ED+2apydd/P WRgDLHa77CDT6K1U+fiS64tpsd28Zw/vk/EZ0hjry9rC4zdskOG18/K3olSRYp/JiCxCYroyyS sJ7UrfgeO1T2hRr2hDRsSaBxTdEN4u13hpA7z9U2Sm5rBwgzWzRGhMgwWFNTl5Uc8qZCsW6JnW bqsx1PjlrbnK8vw2hfRs7DuoRDyuWw+VotK3J/FUD7EC5HXXmhzaWtQ8lieXXes0CSld69ua16 /m4= From: Thomas Schwinge To: Subject: testsuite: Be more informative for ICEs User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 10 Dec 2021 23:42:20 +0100 Message-ID: <87h7bgdqur.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! OK to push the attached "testsuite: Be more informative for ICEs"? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 5ffc2cfc9c6ec6ed0937311377118efd648f0297 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 10 Dec 2021 19:08:26 +0100 Subject: [PATCH] testsuite: Be more informative for ICEs 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 | 8 ++++---- gcc/testsuite/lib/gcc-defs.exp | 4 ++-- gcc/testsuite/lib/gcc-dg.exp | 6 +++--- gcc/testsuite/lib/go-torture.exp | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/testsuite/lib/fortran-torture.exp b/gcc/testsuite/lib/fortran-torture.exp index d6759aa0b4b..11d73d9f1f7 100644 --- a/gcc/testsuite/lib/fortran-torture.exp +++ b/gcc/testsuite/lib/fortran-torture.exp @@ -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 } diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index d17308d0f86..66df4e1c6aa 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -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 } diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 78a6c3651ef..464059608b8 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -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] } diff --git a/gcc/testsuite/lib/go-torture.exp b/gcc/testsuite/lib/go-torture.exp index 28247a1902d..adeae36f916 100644 --- a/gcc/testsuite/lib/go-torture.exp +++ b/gcc/testsuite/lib/go-torture.exp @@ -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 } -- 2.25.1