Debian Codegraph @

gcc/testsuite/c-c++-common/analyzer/infinite-recursion-4-limited.c

raw
1 /* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex" } */
2
3 /* A two-deep mutual recursion, walking a singly-linked list,
4 with a depth limit. */
5
6 struct node
7 {
8 struct node *child;
9 };
10
11 void foo (struct node *f, int depth);
12
13 void bar (struct node *b, int depth)
14 {
15 foo (b, depth); /* { dg-bogus "infinite recursion" } */
16 }
17
18 void foo (struct node *f, int depth)
19 {
20 if (f->child && depth > 0)
21 bar (f->child, depth - 1); /* { dg-bogus "infinite recursion" } */
22 }