• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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);
nested5()4 int nested5() {
5   if (5 < 3)
6     return 0;
7   else
8     if (3 == 3)
9       return 0;
10   return 0;
11 }
nested4()12 int nested4() {
13   return nested5();
14 }
nested3()15 int nested3() {
16   return nested4();
17 }
nested2()18 int nested2() {
19   return nested3();
20 }
nested1()21 int nested1() {
22   return nested2();
23 }
24 
testNested()25 void testNested() {
26   clang_analyzer_eval(nested1() == 0); // expected-warning{{TRUE}}
27 }
28 
29 // Make sure we terminate a recursive path.
recursive()30 int recursive() {
31   return recursive();
32 }
callRecursive()33 int callRecursive() {
34   return recursive();
35 }
36 
37 int mutuallyRecursive1();
38 
mutuallyRecursive2()39 int mutuallyRecursive2() {
40   return mutuallyRecursive1();
41 }
42 
mutuallyRecursive1()43 int mutuallyRecursive1() {
44   return mutuallyRecursive2();
45 }
callMutuallyRecursive()46 int callMutuallyRecursive() {
47   return mutuallyRecursive1();
48 }
49