diff options
author | Haojian Wu <hokein@google.com> | 2016-10-14 13:01:36 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-10-14 13:01:36 +0000 |
commit | 823440e4998f16abf4647c90ed2ff26177a49ed7 (patch) | |
tree | 262b08fadc9d03dc9facaf05eb8276518868646d /clang-tools-extra/test/clang-move | |
parent | 04d9d2b9cc97c76531c68b0097ee398f888d3a38 (diff) |
[clang-move] Add header guard for the new header.
Summary:
The header guard generated by clang-move isn't always a perfect
style, just avoid getting the header included multiple times during
compiling period.
Also, we can use llvm-Header-guard clang-tidy check to correct the guard
automatically.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25610
Diffstat (limited to 'clang-tools-extra/test/clang-move')
-rw-r--r-- | clang-tools-extra/test/clang-move/move-class.cpp | 4 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-move/move-multiple-classes.cpp | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-move/move-class.cpp b/clang-tools-extra/test/clang-move/move-class.cpp index cfe0d0fbd37..81f650093eb 100644 --- a/clang-tools-extra/test/clang-move/move-class.cpp +++ b/clang-tools-extra/test/clang-move/move-class.cpp @@ -21,6 +21,9 @@ // RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s // RUN: FileCheck -input-file=%T/clang-move/include/test.h %s -implicit-check-not='{{namespace.*}}' // +// +// CHECK-NEW-TEST-H: #ifndef {{.*}}CLANG_MOVE_NEW_TEST_H +// CHECK-NEW-TEST-H: #define {{.*}}CLANG_MOVE_NEW_TEST_H // CHECK-NEW-TEST-H: namespace a { // CHECK-NEW-TEST-H: class Foo { // CHECK-NEW-TEST-H: public: @@ -28,6 +31,7 @@ // CHECK-NEW-TEST-H: int f2(int a, int b); // CHECK-NEW-TEST-H: }; // CHECK-NEW-TEST-H: } // namespace a +// CHECK-NEW-TEST-H: #endif // {{.*}}CLANG_MOVE_NEW_TEST_H // // CHECK-NEW-TEST-CPP: #include "{{.*}}new_test.h" // CHECK-NEW-TEST-CPP: #include "test2.h" diff --git a/clang-tools-extra/test/clang-move/move-multiple-classes.cpp b/clang-tools-extra/test/clang-move/move-multiple-classes.cpp index e9a72364a05..f33ac752d36 100644 --- a/clang-tools-extra/test/clang-move/move-multiple-classes.cpp +++ b/clang-tools-extra/test/clang-move/move-multiple-classes.cpp @@ -24,6 +24,8 @@ // CHECK-OLD-TEST-CPP: } // CHECK-OLD-TEST-CPP: } // namespace c +// CHECK-NEW-TEST-H: #ifndef {{.*}}NEW_MULTIPLE_CLASS_TEST_H +// CHECK-NEW-TEST-H: #define {{.*}}NEW_MULTIPLE_CLASS_TEST_H // CHECK-NEW-TEST-H: namespace a { // CHECK-NEW-TEST-H: class Move1 { // CHECK-NEW-TEST-H: public: @@ -54,6 +56,7 @@ // CHECK-NEW-TEST-H: static int a; // CHECK-NEW-TEST-H: }; // CHECK-NEW-TEST-H: } // namespace c +// CHECK-NEW-TEST-H: #endif // {{.*}}NEW_MULTIPLE_CLASS_TEST_H // CHECK-NEW-TEST-CPP: #include "{{.*}}new_multiple_class_test.h" // CHECK-NEW-TEST-CPP: namespace a { |