]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/c-c++-common/torture/harden-cfr-bret-nothrow.c
hardcfr: make builtin_return tests more portable [PR112334]
[thirdparty/gcc.git] / gcc / testsuite / c-c++-common / torture / harden-cfr-bret-nothrow.c
1 /* { dg-do compile } */
2 /* { dg-options "-fharden-control-flow-redundancy -fhardcfr-check-noreturn-calls=nothrow -fno-exceptions -fdump-tree-hardcfr -ffat-lto-objects" } */
3 /* { dg-require-effective-target untyped_assembly } */
4
5 /* Check that, even enabling checks before nothrow noreturn calls (leaving
6 returning calls enabled), we get checks before __builtin_return without
7 duplication (__builtin_return is both noreturn and a returning call). */
8
9 #include "harden-cfr-bret.c"
10
11 /* Out-of-line checking, before both builtin_return and return in f. */
12 /* { dg-final { scan-tree-dump-times "__hardcfr_check" 2 "hardcfr" } } */
13 /* Inline checking before builtin_return in g. */
14 /* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "hardcfr" } } */