1 /* Integration test of how the execution path looks for
2 -Wanalyzer-infinite-recursion. */
4 /* { dg-additional-options "-fdiagnostics-show-path-depths" } */
5 /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
10 foo (flag
); /* { dg-warning "infinite recursion" } */
13 /* { dg-begin-multiline-output "" }
16 'foo': events 1-4 (depth 1)
21 | (1) initial entry to 'foo'
26 | (2) following 'true' branch (when 'flag != 0')...
31 | (4) calling 'foo' from 'foo'
33 +--> 'foo': events 5-6 (depth 2)
38 | (5) recursive entry to 'foo'; previously entered at (1)
39 | (6) apparently infinite recursion
41 { dg-end-multiline-output "" { target c } } */
42 /* { dg-begin-multiline-output "" }
45 'void foo(int)': events 1-4 (depth 1)
50 | (1) initial entry to 'foo'
55 | (2) following 'true' branch (when 'flag != 0')...
60 | (4) calling 'foo' from 'foo'
62 +--> 'void foo(int)': events 5-6 (depth 2)
67 | (5) recursive entry to 'foo'; previously entered at (1)
68 | (6) apparently infinite recursion
70 { dg-end-multiline-output "" { target c++ } } */