diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 98ede70f23c05d843035bd6a522ea64f35c0cdf0..797775e90de9c21e3350898f4881c59ffe975143 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2996,11 +2996,12 @@ Target uses @code{__cxa_atexit}. Target has packed layout of structure members by default. @item exceptions -Target supports exceptions. +Target supports exception handling. +Note that this is orthogonal to effective-target @code{exceptions_enabled}. @item exceptions_enabled -Target supports exceptions and they are enabled in the current -testing configuration. +Testing configuration has exception handling enabled. +Note that this is orthogonal to effective-target @code{exceptions}. @item fgraphite Target supports Graphite optimizations. diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 65a5f3f1dbe5eda5877f6a3dba2ae0d1713e881e..07a996a446697934c8131b4e3168bde22daa84cb 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -434,8 +434,7 @@ proc gcc-dg-prune { system text } { return "::unsupported::large return values" } - # If exceptions are disabled, mark tests expecting exceptions to be enabled - # as unsupported. + # If exception handling is disabled, expectant tests are UNSUPPORTED. if { ![check_effective_target_exceptions_enabled] } { if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] { return "::unsupported::exception handling disabled" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 60e24129bd5858dadd91084a8b222f514ad9418c..aed2b79c4af707ea7aa528fa5630e696d0893428 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -12559,7 +12559,8 @@ proc check_effective_target_fenv_exceptions_long_double {} { } [add_options_for_ieee "-std=gnu99"]] } -# Return 1 if -fexceptions is supported. +# Check whether the target supports exception handling. +# Note that this is orthogonal to effective-target 'exceptions_enabled'. proc check_effective_target_exceptions {} { if { [istarget amdgcn*-*-*] } { @@ -12568,23 +12569,20 @@ proc check_effective_target_exceptions {} { return 1 } -# Used to check if the testing configuration supports exceptions. -# Returns 0 if exceptions are unsupported or disabled (e.g. by passing -# -fno-exceptions). Returns 1 if exceptions are enabled. +# Check whether the testing configuration has exception handling enabled. +# Returns 0 if exception handling is disabled (e.g. by passing +# -fno-exceptions). Returns 1 if exception handling is enabled. +# Note that this is orthogonal to effective-target 'exceptions'. + proc check_effective_target_exceptions_enabled {} { return [check_cached_effective_target exceptions_enabled { - if { [check_effective_target_exceptions] } { - return [check_no_compiler_messages exceptions_enabled assembly { - // C++ - void foo (void) - { - throw 1; - } - }] - } else { - # If exceptions aren't supported, then they're not enabled. - return 0 - } + return [check_no_compiler_messages exceptions_enabled assembly { + // C++ + void foo (void) + { + throw 1; + } + }] }] } diff --git a/libstdc++-v3/testsuite/lib/prune.exp b/libstdc++-v3/testsuite/lib/prune.exp index 3048ffffdb22c18597d3a9b2949e58009f19b278..593b74985fbef2c18db50d211fd12b6e79687254 100644 --- a/libstdc++-v3/testsuite/lib/prune.exp +++ b/libstdc++-v3/testsuite/lib/prune.exp @@ -89,8 +89,7 @@ proc libstdc++-dg-prune { system text } { # the single uncapitalized "in function" line. regsub -all "(^|\n)\[^\n\]*: in function\[^\n\]*" $text "" text - # If exceptions are disabled, mark tests expecting exceptions to be enabled - # as unsupported. + # If exception handling is disabled, expectant tests are UNSUPPORTED. if { ![check_effective_target_exceptions_enabled] } { if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] { return "::unsupported::exception handling disabled"