Debian Codegraph @

libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C

raw
1 /* Exception handling constructs in dead code, '-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 -O0 } */
10 /* { dg-additional-options -fdump-tree-optimized-raw }
11 { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
12
13 #include "target-exceptions-pr118794-1.C"
14
15 /* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
16 '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
17 { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized { target { ! { arm_eabi || tic6x-*-* } } } } }
18 { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized { target { ! { arm_eabi || tic6x-*-* } } } } }
19 ..., just 'targetm.arm_eabi_unwinder' is different:
20 { dg-final { scan-tree-dump-times {gimple_call <__builtin_cxa_end_cleanup, } 1 optimized { target { arm_eabi || tic6x-*-* } } } }
21 { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
22 { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
23 Given '-O0' and '-foffload-options=-mno-fake-exceptions', offload compilation fails:
24 { dg-regexp {[^\r\n]+: In function 'f':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
25 (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
26 { dg-excess-errors {'mkoffload' failure etc.} } */