Debian Codegraph @

clang/test/Analysis/inlining/test-always-inline-size-option.c

raw
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-inline-max-stack-depth=3 -analyzer-config ipa-always-inline-size=3 -verify %s
2
3 void clang_analyzer_eval(int);
4 int nested5(void) {
5 if (5 < 3)
6 return 0;
7 else
8 if (3 == 3)
9 return 0;
10 return 0;
11 }
12 int nested4(void) {
13 return nested5();
14 }
15 int nested3(void) {
16 return nested4();
17 }
18 int nested2(void) {
19 return nested3();
20 }
21 int nested1(void) {
22 return nested2();
23 }
24
25 void testNested(void) {
26 clang_analyzer_eval(nested1() == 0); // expected-warning{{TRUE}}
27 }
28
29 // Make sure we terminate a recursive path.
30 int recursive(void) {
31 return recursive();
32 }
33 int callRecursive(void) {
34 return recursive();
35 }
36
37 int mutuallyRecursive1(void);
38
39 int mutuallyRecursive2(void) {
40 return mutuallyRecursive1();
41 }
42
43 int mutuallyRecursive1(void) {
44 return mutuallyRecursive2();
45 }
46 int callMutuallyRecursive(void) {
47 return mutuallyRecursive1();
48 }