]> git.proxmox.com Git - rustc.git/blob - src/llvm/tools/clang/test/Analysis/inlining/test-always-inline-size-option.c
Imported Upstream version 0.6
[rustc.git] / src / llvm / tools / clang / test / Analysis / inlining / test-always-inline-size-option.c
1 // RUN: %clang_cc1 -analyze -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() {
5 if (5 < 3)
6 return 0;
7 else
8 if (3 == 3)
9 return 0;
10 return 0;
11 }
12 int nested4() {
13 return nested5();
14 }
15 int nested3() {
16 return nested4();
17 }
18 int nested2() {
19 return nested3();
20 }
21 int nested1() {
22 return nested2();
23 }
24
25 void testNested() {
26 clang_analyzer_eval(nested1() == 0); // expected-warning{{TRUE}}
27 }
28
29 // Make sure we terminate a recursive path.
30 int recursive() {
31 return recursive();
32 }
33 int callRecursive() {
34 return recursive();
35 }
36
37 int mutuallyRecursive1();
38
39 int mutuallyRecursive2() {
40 return mutuallyRecursive1();
41 }
42
43 int mutuallyRecursive1() {
44 return mutuallyRecursive2();
45 }
46 int callMutuallyRecursive() {
47 return mutuallyRecursive1();
48 }