(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
feasibility-4.c
       1  #include "analyzer-decls.h"
       2  
       3  extern int rand (void);
       4  
       5  void test_1 (void)
       6  {
       7    int   ret = 0;
       8    while (ret != 42)
       9      ret = rand() % 1000;
      10  
      11    if (ret != 42)
      12      __analyzer_dump_path (); /* { dg-bogus "path" } */
      13  }
      14  
      15  static void empty_local_fn (void) {}
      16  extern void external_fn (void);
      17  
      18  void test_2 (void)
      19  {
      20    void (*callback) () = empty_local_fn;
      21    int   ret = 0;
      22    while (ret != 42)
      23      ret = rand() % 1000;
      24  
      25    (*callback) ();
      26  
      27    if (ret != 42)
      28      __analyzer_dump_path (); /* { dg-bogus "path" } */
      29  }
      30  
      31  void test_3 (void)
      32  {
      33    void (*callback) () = external_fn;
      34    int   ret = 0;
      35    while (ret != 42)
      36      ret = rand() % 1000;
      37  
      38    (*callback) ();
      39  
      40    if (ret != 42)
      41      __analyzer_dump_path (); /* { dg-bogus "path" } */
      42  }