aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/torture/harden-cfr-abrt.c
blob: 1ed727317f13806f593b3b94e83fafcc7ed3f4d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-fharden-control-flow-redundancy -fdump-tree-hardcfr -ffat-lto-objects" } */

/* Check the noreturn handling of a builtin call.  */

int f(int i) {
  if (!i)
    __builtin_abort ();
  return i;
}

int g() {
  __builtin_abort ();
}

/* Out-of-line checking, before both builtin_abort and return in f.  */
/* { dg-final { scan-tree-dump-times "__hardcfr_check" 2 "hardcfr" } } */
/* Inline checking before builtin_return in g.  */
/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "hardcfr" } } */