Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / infinite-recursion.c
blob6b7d25cfabe6c576b0e13964813020fe7d6b7779
1 extern void marker_A(void);
2 extern void marker_B(void);
3 extern void marker_C(void);
4 extern void marker_D(void);
6 void test(int flag)
8 marker_A();
10 if (flag) {
11 marker_B();
13 /* Recurse, infinitely, as it happens: */
14 test(flag); /* { dg-warning "infinite recursion" } */
16 marker_C();
19 marker_D();
22 /* A cycle of 4 mutually-recursive functions (but only for certain inputs). */
24 extern void mutual_test_1 (int flag);
25 extern void mutual_test_2 (int flag);
26 extern void mutual_test_3 (int flag);
27 extern void mutual_test_4 (int flag);
29 void mutual_test_1 (int flag)
31 marker_A ();
32 if (flag)
33 mutual_test_2 (flag); /* { dg-warning "infinite recursion" } */
36 void mutual_test_2 (int flag)
38 marker_B ();
39 if (flag)
40 mutual_test_3 (flag); /* { dg-warning "infinite recursion" } */
43 void mutual_test_3 (int flag)
45 marker_C ();
46 if (flag)
47 mutual_test_4 (flag); /* { dg-warning "infinite recursion" } */
50 void mutual_test_4 (int flag)
52 marker_D ();
53 if (flag)
54 mutual_test_1 (flag); /* { dg-warning "infinite recursion" } */