Skip a number of 'g++.dg/lto/' test cases for '-fno-exceptions' testing
commit94782ed70796427e6f4b15b1c2df91cd7bef28e8
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 7 Jun 2023 14:11:11 +0000 (7 16:11 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 3 Nov 2023 10:59:15 +0000 (3 11:59 +0100)
tree50f81926dc18fb92f20e35486b28ec4930f0b001
parente5919951b8cb0dc8af5b80dc747416fb60a9835b
Skip a number of 'g++.dg/lto/' 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 "split files" test cases.  For example:

    [-PASS:-]{+UNSUPPORTED:+} g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o [-assemble, -fPIC -flto -flto-partition=1to1-]{+assemble: exception handling disabled+}
    [-PASS:-]{+UNRESOLVED:+} g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o-cp_lto_20081109-1_0.o [-link,-]{+link+} -fPIC -flto -flto-partition=1to1
    {+UNRESOLVED: g++.dg/lto/20081109-1 cp_lto_20081109-1_0.o-cp_lto_20081109-1_0.o execute -fPIC -flto -flto-partition=1to1+}

The "compile"/"assemble" tests (either continue to work, or) result in the
expected 'UNSUPPORTED: [...] compile: exception handling disabled', but
dependent "link" and "execute" tests then turn UNRESOLVED.

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

gcc/testsuite/
* g++.dg/lto/20081109-1_0.C: Specify
'dg-require-effective-target exceptions_enabled'.
* g++.dg/lto/20081109_0.C: Likewise.
* g++.dg/lto/20091026-1_0.C: Likewise.
* g++.dg/lto/pr87906_0.C: Likewise.
* g++.dg/lto/pr88046_0.C: Likewise.
gcc/testsuite/g++.dg/lto/20081109-1_0.C
gcc/testsuite/g++.dg/lto/20081109_0.C
gcc/testsuite/g++.dg/lto/20091026-1_0.C
gcc/testsuite/g++.dg/lto/pr87906_0.C
gcc/testsuite/g++.dg/lto/pr88046_0.C