summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h9
-rw-r--r--clang-tools-extra/test/clang-tidy/overlapping.cpp10
2 files changed, 19 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h b/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h
new file mode 100644
index 00000000000..bfa7a0a9b39
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/Inputs/overlapping/o.h
@@ -0,0 +1,9 @@
+// run: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \
+// run: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \
+// run: not grep "note: this fix will not be applied because it overlaps with another fix"
+
+#include "b.h"
+#include "a.h"
+
+// The comments above are there to match the offset of the #include with the
+// offset of the #includes in the .cpp file.
diff --git a/clang-tools-extra/test/clang-tidy/overlapping.cpp b/clang-tools-extra/test/clang-tidy/overlapping.cpp
new file mode 100644
index 00000000000..f970a136892
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/overlapping.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-tidy -checks=-*,llvm-include-order -header-filter=.* %s \
+// RUN: -- -isystem %S/Inputs/Headers -I %S/Inputs/overlapping | \
+// RUN: not grep "note: this fix will not be applied because it overlaps with another fix"
+
+#include <s.h>
+#include "o.h"
+
+// Test that clang-tidy takes into account in which file we are doing the
+// replacements to determine if they overlap or not. In the file "o.h" there is
+// a similar error at the same file offset, but they do not overlap.
OpenPOWER on IntegriCloud