Debian Codegraph @

libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C

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