(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
torture/
harden-cond.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-fharden-conditional-branches -fdump-tree-hardcbr -ffat-lto-objects" } */
       3  
       4  extern int f1 (void);
       5  extern int f2 (void);
       6  
       7  
       8  int
       9  f (int i, int j)
      10  {
      11    return (i < j) ? f1 () : f2 ();
      12  }
      13  
      14  /* { dg-final { scan-tree-dump-times "Splitting edge" 2 "hardcbr" } } */
      15  /* { dg-final { scan-tree-dump-times "Adding reversed compare" 2 "hardcbr" } } */
      16  /* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "hardcbr" } } */
      17  /* { dg-final { scan-tree-dump-times "if \[(\]i_\[0-9\]*\[(\]D\[)\] < j_\[0-9\]*\[(\]D\[)\]\[)\]" 1 "hardcbr" } } */
      18  /* { dg-final { scan-tree-dump-times "if \[(\]_\[0-9\]* >= _\[0-9\]*\[)\]" 2 "hardcbr" } } */