2017-09-04 13:56:36 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-output=plist -analyzer-config notes-as-events=true -o %t.plist -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -verify %s
|
2019-06-11 07:25:43 +08:00
|
|
|
// RUN: cat %t.plist | %diff_plist %S/Inputs/expected-plists/plist-diagnostics-notes-as-events.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) { // no-note (converted into event)
|
|
|
|
log();
|
|
|
|
if (a > b)
|
|
|
|
return a;
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|