Debian Codegraph @

gcc/testsuite/g++.dg/torture/harden-cfr-noret-no-nothrow.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fharden-control-flow-redundancy -fhardcfr-check-noreturn-calls=nothrow -fdump-tree-hardcfr -ffat-lto-objects" } */
3
4 /* Check that C++ does NOT make for implicit nothrow in noreturn
5 handling. */
6
7 #define ATTR_NOTHROW_OPT
8
9 #if ! __OPTIMIZE__
10 void __attribute__ ((__noreturn__)) h (void);
11 #endif
12
13 #include "../../c-c++-common/torture/harden-cfr-noret.c"
14
15 /* All 3 noreturn calls. */
16 /* { dg-final { scan-tree-dump-times "Associated cleanup" 3 "hardcfr" } } */
17 /* Out-of-line checks in f. */
18 /* { dg-final { scan-tree-dump-times "Inserting out-of-line check in block \[0-9]*'s edge to exit" 1 "hardcfr" } } */
19 /* { dg-final { scan-tree-dump-times "Inserting out-of-line check before stmt" 1 "hardcfr" } } */
20 /* { dg-final { scan-tree-dump-times "hardcfr_check" 2 "hardcfr" } } */
21 /* Inline checks in h and h2. */
22 /* { dg-final { scan-tree-dump-times "Inserting inline check before stmt" 2 "hardcfr" } } */
23 /* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "hardcfr" } } */