diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-10 08:48:30 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-09-10 08:48:30 +0000 |
commit | ad335cf690c19510d62a3b627e2657bf9b8920fd (patch) | |
tree | 96c52ea22f939eee36c3f5f77caa94fc4894284f /clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp | |
parent | eb19aea4f987eefe344304de1a90183db973c861 (diff) | |
download | bcm5719-llvm-ad335cf690c19510d62a3b627e2657bf9b8920fd.tar.gz bcm5719-llvm-ad335cf690c19510d62a3b627e2657bf9b8920fd.zip |
[clang-tidy] Don't try to fix header guard #endif comments if there are escaped
newlines involved.
Getting that right is just not worth it.
llvm-svn: 217480
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp index 199329b8ede..0d43cc933f6 100644 --- a/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/LLVMModuleTest.cpp @@ -170,6 +170,20 @@ TEST(LLVMHeaderGuardCheckTest, FixHeaderGuards) { runHeaderGuardCheckWithEndif( "#ifndef LLVM_ADT_FOO_H_\n#define LLVM_ADT_FOO_H_\n#endif // LLVM\n", "include/llvm/ADT/foo.h")); + + EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif \\ \n// " + "LLVM_ADT_FOO_H\n", + runHeaderGuardCheckWithEndif("#ifndef LLVM_ADT_FOO_H\n#define " + "LLVM_ADT_FOO_H\n#endif \\ \n// " + "LLVM_ADT_FOO_H\n", + "include/llvm/ADT/foo.h")); + + EXPECT_EQ("#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif /* " + "LLVM_ADT_FOO_H\\ \n FOO */", + runHeaderGuardCheckWithEndif( + "#ifndef LLVM_ADT_FOO_H\n#define LLVM_ADT_FOO_H\n#endif /* " + "LLVM_ADT_FOO_H\\ \n FOO */", + "include/llvm/ADT/foo.h")); } #endif |