]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Skip a number of 'g++.dg/tree-prof/' test cases for '-fno-exceptions' testing
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 14 Jun 2023 20:39:01 +0000 (22:39 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Nov 2023 10:59:15 +0000 (11:59 +0100)
Running 'make check' with: 'RUNTESTFLAGS=--target_board=unix/-fno-exceptions',
'error: exception handling disabled' is triggered for C++ 'throw' etc. usage,
and per 'gcc/testsuite/lib/gcc-dg.exp:gcc-dg-prune':

    # If exceptions are disabled, mark tests expecting exceptions to be enabled
    # as unsupported.
    if { ![check_effective_target_exceptions_enabled] } {
        if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
          return "::unsupported::exception handling disabled"
        }

..., which generally means:

    -PASS: [...] (test for excess errors)
    +UNSUPPORTED: [...]: exception handling disabled

However, this doesn't work for 'g++.dg/tree-prof/' test cases.  For example:

    [-PASS:-]{+UNSUPPORTED:+} g++.dg/tree-prof/indir-call-prof-2.C [-compilation,  -fprofile-generate -D_PROFILE_GENERATE-]{+compilation: exception handling disabled+}
    [-PASS:-]{+UNRESOLVED:+} g++.dg/tree-prof/indir-call-prof-2.C execution,    -fprofile-generate -D_PROFILE_GENERATE
    [-PASS:-]{+UNRESOLVED:+} g++.dg/tree-prof/indir-call-prof-2.C compilation,  -fprofile-use -D_PROFILE_USE
    [-PASS:-]{+UNRESOLVED:+} g++.dg/tree-prof/indir-call-prof-2.C execution,    -fprofile-use -D_PROFILE_USE

Dependent tests turn UNRESOLVED if the first "compilation" runs into the
expected 'UNSUPPORTED: [...] compile: exception handling disabled'.

Specify 'dg-require-effective-target exceptions_enabled' for those test cases.

gcc/testsuite/
* g++.dg/tree-prof/indir-call-prof-2.C: Specify
'dg-require-effective-target exceptions_enabled'.
* g++.dg/tree-prof/partition1.C: Likewise.
* g++.dg/tree-prof/partition2.C: Likewise.
* g++.dg/tree-prof/partition3.C: Likewise.
* g++.dg/tree-prof/pr51719.C: Likewise.
* g++.dg/tree-prof/pr57451.C: Likewise.
* g++.dg/tree-prof/pr59255.C: Likewise.

gcc/testsuite/g++.dg/tree-prof/indir-call-prof-2.C
gcc/testsuite/g++.dg/tree-prof/partition1.C
gcc/testsuite/g++.dg/tree-prof/partition2.C
gcc/testsuite/g++.dg/tree-prof/partition3.C
gcc/testsuite/g++.dg/tree-prof/pr51719.C
gcc/testsuite/g++.dg/tree-prof/pr57451.C
gcc/testsuite/g++.dg/tree-prof/pr59255.C

index e20cc64d37392cbd5ec012e39aa7773fa1e132ce..5b6f172b025bd555dd4a246bb33ee12cd99521d4 100644 (file)
@@ -1,3 +1,4 @@
+/* Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.  */
 /* { dg-options "-O" } */
 
 int foo1(void) { return 0; }
index d0dcbc4524b9e4c46c241b9a900f313f4fa3bfc6..8dd64aa27a51ab2b3781d48567c55c792403d091 100644 (file)
@@ -1,3 +1,4 @@
+/* Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.  */
 /* { dg-require-effective-target freorder } */
 /* { dg-options "-O2 -freorder-blocks-and-partition" } */
 
index 0bc50fae98a3818ea1d91cc179f31bac67db9de1..580d0e06c00920c0d3d73cb496843e31e0cb6093 100644 (file)
@@ -1,4 +1,5 @@
 // PR middle-end/45458
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
 // { dg-require-effective-target freorder }
 // { dg-options "-O2 -fnon-call-exceptions -freorder-blocks-and-partition" }
 
index c62174aa4d31f2e4a25291f0b4d5519560d47f39..6cd51cc157e797717a9fc12f22f78b572bbb4b29 100644 (file)
@@ -1,4 +1,5 @@
 // PR middle-end/45566
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
 // { dg-require-effective-target freorder }
 // { dg-options "-O2 -fnon-call-exceptions -freorder-blocks-and-partition" }
 
index 01e81ff66eda0f46fafcb25ea69c4252bf4b03cb..a4c99a1db87e97704a65206615931374466a749d 100644 (file)
@@ -1,4 +1,5 @@
 // PR tree-optimization/51719
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
 // { dg-options "-O -fpartial-inlining" }
 
 int
index db0fcc1e8efcd444535a37d27dafd3889303ade2..8fbc1214095b870236572ba6c8df5f2908ff75bb 100644 (file)
@@ -1,3 +1,4 @@
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
 // { dg-require-effective-target freorder }
 // { dg-options "-O2 -freorder-blocks-and-partition -g" }
 
index 77f208a3a5fe4800a332e2ef75a8d6f905b58076..6db136846d087461f96fcd98076a4a84fa3cef5a 100644 (file)
@@ -1,4 +1,5 @@
 // PR c++/59255
+// Explicit { dg-require-effective-target exceptions_enabled } so that dependent tests don't turn UNRESOLVED for '-fno-exceptions'.
 // { dg-options "-std=c++11 -O2" }
 
 struct S