1 // RUN: %clang_cc1 -analyze -std=c++1z -analyzer-checker=alpha.clone.CloneChecker -verify %s 2 3 // expected-no-diagnostics 4 5 bool a(); 6 bool b(); 7 8 // Calls method a with some extra code to pass the minimum complexity 9 bool foo1(int x) { 10 if (x > 0) 11 return false; 12 else if (x < 0) 13 return a(); 14 return true; 15 } 16 17 // Calls method b with some extra code to pass the minimum complexity 18 bool foo2(int x) { 19 if (x > 0) 20 return false; 21 else if (x < 0) 22 return b(); 23 return true; 24 } 25 26 // Test that we don't crash on function pointer calls 27 28 bool (*funcPtr)(int); 29 30 bool fooPtr1(int x) { 31 if (x > 0) 32 return false; 33 else if (x < 0) 34 return funcPtr(1); 35 return true; 36 } 37