Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / copypaste / clone-begin-end-different-file.cpp
bloba5f1b668feff450562d9673701c037d006688b76
1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.clone.CloneChecker -analyzer-config alpha.clone.CloneChecker:MinimumCloneComplexity=5 -verify %s
3 // This test should verify that there is no crash if the detected clone range
4 // starts in a file and ends in a different file.
6 void f_end(int i) {
7 if (i == 10) // expected-warning{{Duplicate code detected}}
8 #include "Inputs/clone-begin-end-different-file-end.inc"
9 if (i == 10) // expected-note{{Similar code here}}
10 #include "Inputs/clone-begin-end-different-file-end.inc"
13 void f_begin(int i) {
14 #include "Inputs/clone-begin-end-different-file-begin-1.inc"
15 if (true) {}
16 #include "Inputs/clone-begin-end-different-file-begin-2.inc"
17 if (true) {}
20 #define X while (true) {}
22 void f1m(int i) {
23 if (i == 10) // expected-warning{{Duplicate code detected}}
24 #include "Inputs/clone-begin-end-different-file-end-macro.inc"
25 if (i == 10) // expected-note{{Similar code here}}
26 #include "Inputs/clone-begin-end-different-file-end-macro.inc"
29 #undef X
30 #define X if (i == 10)
32 void f2m(int i) {
33 #include "Inputs/clone-begin-end-different-file-begin-macro-1.inc"
34 while (true) { i = 1; }
35 #include "Inputs/clone-begin-end-different-file-begin-macro-2.inc"
36 while (true) { i = 1; }