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.
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"
14 #include "Inputs/clone-begin-end-different-file-begin-1.inc"
16 #include "Inputs/clone-begin-end-different-file-begin-2.inc"
20 #define X while (true) {}
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"
30 #define X if (i == 10)
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; }