1 // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
3 // This tests if we search for clones in functions.
7 int max(int a
, int b
) { // expected-warning{{Duplicate code detected}}
14 int maxClone(int x
, int y
) { // expected-note{{Similar code here}}
21 // Functions below are not clones and should not be reported.
23 // The next two functions test that statement classes are still respected when
24 // checking for clones in expressions. This will show that the statement
25 // specific data of all base classes is collected, and not just the data of the
27 int testBaseClass(int a
, int b
) { // no-warning
33 int testBaseClass2(int a
, int b
) { // no-warning
36 return __builtin_choose_expr(true, a
, b
);
40 // No clone because of the different comparison operator.
41 int min1(int a
, int b
) { // no-warning
48 // No clone because of the different pattern in which the variables are used.
49 int min2(int a
, int b
) { // no-warning
56 int foo(int a
, int b
) { // no-warning