1  /* Integration test of how the execution path looks for
       2     -Wanalyzer-infinite-recursion.  */
       3  
       4  /* { dg-additional-options "-fdiagnostics-show-path-depths" } */
       5  /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
       6  
       7  void foo (int flag)
       8  {
       9    if (flag)
      10      foo (flag); /* { dg-warning "infinite recursion" } */
      11  }
      12  
      13  /* { dg-begin-multiline-output "" }
      14       foo (flag);
      15       ^~~~~~~~~~
      16    'foo': events 1-4 (depth 1)
      17      |
      18      | void foo (int flag)
      19      |      ^~~
      20      |      |
      21      |      (1) initial entry to 'foo'
      22      |
      23      |   if (flag)
      24      |      ~
      25      |      |
      26      |      (2) following 'true' branch (when 'flag != 0')...
      27      |     foo (flag);
      28      |     ~~~~~~~~~~
      29      |     |
      30      |     (3) ...to here
      31      |     (4) calling 'foo' from 'foo'
      32      |
      33      +--> 'foo': events 5-6 (depth 2)
      34             |
      35             | void foo (int flag)
      36             |      ^~~
      37             |      |
      38             |      (5) recursive entry to 'foo'; previously entered at (1)
      39             |      (6) apparently infinite recursion
      40             |
      41     { dg-end-multiline-output "" } */