| 1 |
/* 'std::bad_cast' exception in OpenMP 'target' region, caught, '-foffload-options=-mno-fake-exceptions'. */ |
| 2 |
|
| 3 |
/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually. |
| 4 |
{ dg-do link { target offload_target_nvptx } } |
| 5 |
{ dg-additional-options -foffload=nvptx-none } */ |
| 6 |
/* { dg-require-effective-target exceptions } |
| 7 |
{ dg-additional-options -fexceptions } */ |
| 8 |
/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */ |
| 9 |
/* { dg-additional-options -fdump-tree-optimized-raw } |
| 10 |
{ dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */ |
| 11 |
|
| 12 |
#include "target-exceptions-bad_cast-2.C" |
| 13 |
|
| 14 |
/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } |
| 15 |
{ dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } |
| 16 |
Given '-foffload-options=-mno-fake-exceptions', offload compilation fails: |
| 17 |
{ dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} } |
| 18 |
(Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) |
| 19 |
{ dg-excess-errors {'mkoffload' failure etc.} } */ |