| 1 |
/* 'std::bad_cast' exception in OpenMP 'target' region, caught. */ |
| 2 |
|
| 3 |
/* { dg-require-effective-target exceptions } |
| 4 |
{ dg-additional-options -fexceptions } */ |
| 5 |
/* { dg-additional-options -fdump-tree-optimized-raw } |
| 6 |
{ dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */ |
| 7 |
/* { dg-bogus {_ZTISt8bad_cast} PR119734 { target offload_target_nvptx xfail *-*-* } 0 } |
| 8 |
{ dg-excess-errors {'mkoffload' failure etc.} { xfail offload_target_nvptx } } */ |
| 9 |
|
| 10 |
#include "../libgomp.oacc-c++/exceptions-bad_cast-2.C" |
| 11 |
|
| 12 |
/* { dg-output {CheCKpOInT[\r\n]+} } |
| 13 |
|
| 14 |
{ dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } |
| 15 |
{ dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } |
| 16 |
{ dg-output {.*caught 'std::bad_cast'[\r\n]+} { target { ! offload_device } } } |
| 17 |
For GCN, nvptx offload execution, we don't print anything, but just 'abort'. |
| 18 |
|
| 19 |
TODO For GCN, nvptx offload execution, this currently doesn't 'abort' due to |
| 20 |
the 'std::bad_cast' exception, but rather due to SIGSEGV in 'dynamic_cast'; |
| 21 |
PR119692. |
| 22 |
|
| 23 |
For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal. |
| 24 |
{ dg-shouldfail {'MyException' exception} { offload_device } } */ |
| 25 |
/* There are configurations where we 'WARNING: program timed out.' while in |
| 26 |
'dynamic_cast', see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119692#c6>. |
| 27 |
{ dg-timeout 10 { target offload_device } } ... to make sure that happens quickly. */ |