aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/infinite-recursion-4-unlimited.c
blob: bdb54a3ee78705b5a53d3a361209def02aa6333d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex" } */

/* A two-deep mutual recursion, walking a linked list (and thus presumably
   terminating), with no explicit depth limit.  */

struct node
{
  struct node *child;
};

void foo (struct node *f);

void bar (struct node *b)
{
  foo (b); /* { dg-bogus "infinite recursion" } */
}

void foo (struct node *f)
{
  if (f->child)
    bar (f->child); /* { dg-bogus "infinite recursion" } */
}