Artem Dergachev | ba81632 | 2016-07-26 18:13:12 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -analyze -fblocks -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -verify %s |
2 | |||||
3 | // This tests if we search for clones in blocks. | ||||
4 | |||||
5 | void log(); | ||||
6 | |||||
7 | auto BlockA = ^(int a, int b){ // expected-warning{{Detected code clone.}} | ||||
8 | log(); | ||||
9 | if (a > b) | ||||
10 | return a; | ||||
11 | return b; | ||||
12 | }; | ||||
13 | |||||
14 | auto BlockB = ^(int a, int b){ // expected-note{{Related code clone is here.}} | ||||
15 | log(); | ||||
16 | if (a > b) | ||||
17 | return a; | ||||
18 | return b; | ||||
19 | }; |