2017-09-04 13:56:36 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-output=plist -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
|
2019-06-11 22:21:32 +08:00
|
|
|
// RUN: %normalize_plist <%t.plist | diff -ub %S/Inputs/expected-plists/plist-diagnostics.cpp.plist -
|
2016-10-08 18:54:30 +08:00
|
|
|
|
|
|
|
void log();
|
|
|
|
|
|
|
|
int max(int a, int b) { // expected-warning{{Duplicate code detected}}
|
|
|
|
log();
|
|
|
|
if (a > b)
|
|
|
|
return a;
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|
|
|
|
int maxClone(int a, int b) { // expected-note{{Similar code here}}
|
|
|
|
log();
|
|
|
|
if (a > b)
|
|
|
|
return a;
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|