diff options
author | Haojian Wu <hokein@google.com> | 2016-11-08 19:55:13 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-11-08 19:55:13 +0000 |
commit | 2c29258ac500597fafe611b35a8c018e4eb766ae (patch) | |
tree | 2ce3fc42bb490c9b2f82146fe04415deb3f345ac /clang-tools-extra/test/clang-move | |
parent | 20eb33ee657b0bd958ce3a66535a6e5d7638dd9c (diff) |
[clang-move] Move all code from old.h/cc directly when moving all class declarations from old.h.
Summary: When moving all code to new.h/cc, these code also will be formatted based on the given code style.
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26236
Diffstat (limited to 'clang-tools-extra/test/clang-move')
-rw-r--r-- | clang-tools-extra/test/clang-move/Inputs/test.h | 3 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-move/move-class.cpp | 17 |
2 files changed, 11 insertions, 9 deletions
diff --git a/clang-tools-extra/test/clang-move/Inputs/test.h b/clang-tools-extra/test/clang-move/Inputs/test.h index 9d0073a0d15..8006c3478da 100644 --- a/clang-tools-extra/test/clang-move/Inputs/test.h +++ b/clang-tools-extra/test/clang-move/Inputs/test.h @@ -1,3 +1,5 @@ +#ifndef TEST_H // comment 1 +#define TEST_H namespace a { class Foo { public: @@ -5,3 +7,4 @@ public: int f2(int a, int b); }; } // namespace a +#endif // TEST_H diff --git a/clang-tools-extra/test/clang-move/move-class.cpp b/clang-tools-extra/test/clang-move/move-class.cpp index 81f650093eb..a30cb4d8e0a 100644 --- a/clang-tools-extra/test/clang-move/move-class.cpp +++ b/clang-tools-extra/test/clang-move/move-class.cpp @@ -9,8 +9,8 @@ // RUN: clang-move -names="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=../src/test.cpp -old_header=../include/test.h %T/clang-move/src/test.cpp // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s -// 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.*}}' +// RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s +// RUN: FileCheck -input-file=%T/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s // // RUN: cp %S/Inputs/test.h %T/clang-move/include // RUN: cp %S/Inputs/test.cpp %T/clang-move/src @@ -18,12 +18,12 @@ // RUN: clang-move -names="a::Foo" -new_cc=%T/clang-move/new_test.cpp -new_header=%T/clang-move/new_test.h -old_cc=%T/clang-move/src/test.cpp -old_header=%T/clang-move/include/test.h %T/clang-move/src/test.cpp // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s -// 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.*}}' +// RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s +// RUN: FileCheck -input-file=%T/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s // // -// CHECK-NEW-TEST-H: #ifndef {{.*}}CLANG_MOVE_NEW_TEST_H -// CHECK-NEW-TEST-H: #define {{.*}}CLANG_MOVE_NEW_TEST_H +// CHECK-NEW-TEST-H: #ifndef TEST_H // comment 1 +// CHECK-NEW-TEST-H: #define TEST_H // CHECK-NEW-TEST-H: namespace a { // CHECK-NEW-TEST-H: class Foo { // CHECK-NEW-TEST-H: public: @@ -31,7 +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-H: #endif // TEST_H // // CHECK-NEW-TEST-CPP: #include "{{.*}}new_test.h" // CHECK-NEW-TEST-CPP: #include "test2.h" @@ -40,5 +40,4 @@ // CHECK-NEW-TEST-CPP: int Foo::f2(int a, int b) { return a + b; } // CHECK-NEW-TEST-CPP: } // namespace a // -// CHECK-OLD-TEST-CPP: #include "test.h" -// CHECK-OLD-TEST-CPP: #include "test2.h" +// CHECK-OLD-TEST-EMPTY: {{^}}{{$}} |