Debian Codegraph @

gcc/testsuite/c-c++-common/torture/harden-cfr-bret-except.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fharden-control-flow-redundancy -fexceptions -fdump-tree-hardcfr -ffat-lto-objects" } */
3 /* { dg-require-effective-target untyped_assembly } */
4
5 /* Check that, with exceptions enabled, even in C, the calls initiated by
6 builtin_apply are enclosed in cleanup handlers that add extra checks.
7 Unfortunately, declaring foobar as nothrow is not enough to avoid the
8 handler around the builtin_apply call, so the other bret tests all use
9 -fno-exceptions. */
10
11 #include "harden-cfr-bret.c"
12
13 /* With exceptions, we get an extra check per function, to check before
14 propagating exceptions, so it's 3 in f and 2 in g. */
15 /* { dg-final { scan-tree-dump-times "__hardcfr_check" 5 "hardcfr" } } */
16 /* The extra check in g also removes the possibility of inlining the check. */
17 /* { dg-final { scan-tree-dump-times "__builtin_trap" 0 "hardcfr" } } */