Artem Dergachev | 78692ea | 2016-08-02 12:21:09 +0000 | [diff] [blame^] | 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 | } |