| 1 |
/* 'throw' 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_amdgcn } } |
| 5 |
{ dg-additional-options -foffload=amdgcn-amdhsa } */ |
| 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-throw-2.C" |
| 13 |
|
| 14 |
/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } } |
| 15 |
{ dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } |
| 16 |
{ dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } } |
| 17 |
{ dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } |
| 18 |
Given '-foffload-options=-mno-fake-exceptions', offload compilation fails: |
| 19 |
{ dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} } |
| 20 |
(Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) |
| 21 |
{ dg-excess-errors {'mkoffload' failure etc.} } */ |