| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fharden-control-flow-redundancy -fhardcfr-check-noreturn-calls=no-xthrow -fno-exceptions -fdump-tree-hardcfr -ffat-lto-objects" } */ |
| 3 |
/* { dg-require-effective-target untyped_assembly } */ |
| 4 |
|
| 5 |
/* Check that, even enabling checks before no-xthrow-throwing noreturn calls |
| 6 |
(leaving returning calls enabled), we get checks before __builtin_return |
| 7 |
without duplication (__builtin_return is both noreturn and a returning |
| 8 |
call). */ |
| 9 |
|
| 10 |
#include "harden-cfr-bret.c" |
| 11 |
|
| 12 |
/* Out-of-line checking, before both builtin_return and return in f. */ |
| 13 |
/* { dg-final { scan-tree-dump-times "__hardcfr_check" 2 "hardcfr" } } */ |
| 14 |
/* Inline checking before builtin_return in g. */ |
| 15 |
/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "hardcfr" } } */ |