Skip a number of 'g++.dg/tree-prof/' test cases for '-fno-exceptions' testing
commit3881d010dca9b5db5301f28e4a1e3a8e4bc40faa
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 14 Jun 2023 20:39:01 +0000 (14 22:39 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Nov 2023 10:59:15 +0000 (3 11:59 +0100)
tree693d5f0ff6ecad2773290f9eac4b04b853111a3d
parent94782ed70796427e6f4b15b1c2df91cd7bef28e8
Skip a number of 'g++.dg/tree-prof/' test cases for '-fno-exceptions' testing

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