Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / copypaste / not-autogenerated.cpp
blobd54ee176fa8868bb7bd26c2e5de27cc68b020081
1 // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=10 -analyzer-config alpha.clone.CloneChecker:IgnoredFilesPattern="moc_|ui_|dbus_|.*_automoc" -verify %s
3 void f1() {
4 int *p1 = new int[1];
5 int *p2 = new int[1];
6 if (p1) {
7 delete [] p1; // expected-note{{Similar code using 'p1' here}}
8 p1 = nullptr;
10 if (p2) {
11 delete [] p1; // expected-warning{{Potential copy-paste error; did you really mean to use 'p1' here?}}
12 p2 = nullptr;