summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2019-09-26 09:56:37 +0000
committerHaojian Wu <hokein@google.com>2019-09-26 09:56:37 +0000
commit0d808e50645703a5993e98f2422df28586547827 (patch)
treefdc6f6638467e6889282cc38d1c7f69c16c1f787 /clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
parent8865ebb509baf677a62ac1761f9b4bb1dfb79a18 (diff)
downloadbcm5719-llvm-0d808e50645703a5993e98f2422df28586547827.tar.gz
bcm5719-llvm-0d808e50645703a5993e98f2422df28586547827.zip
[clang-tidy] Make llvm-header-guard work on llvm git monorepo
Reviewers: gribozavr Reviewed By: gribozavr Subscribers: xazax.hun, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68026 llvm-svn: 372953
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
index aed9f6d831e..b86f8e63fb8 100644
--- a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp
@@ -211,6 +211,15 @@ TEST(LLVMHeaderGuardCheckTest, FixHeaderGuards) {
"#endif /* LLVM_ADT_FOO_H\\ \n"
" FOO */",
"include/llvm/ADT/foo.h", None));
+
+ EXPECT_EQ("#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FOO_H\n"
+ "#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FOO_H\n"
+ "\n"
+ "\n"
+ "#endif\n",
+ runHeaderGuardCheck(
+ "", "/llvm-project/clang-tools-extra/clangd/foo.h",
+ StringRef("header is missing header guard")));
}
#endif
OpenPOWER on IntegriCloud