1 | // RUN: mkdir -p %T/move-multiple-classes |
2 | // RUN: cp %S/Inputs/multiple_class_test* %T/move-multiple-classes/ |
3 | // RUN: cd %T/move-multiple-classes |
4 | // RUN: clang-move -names="c::EnclosingMove5::Nested" -new_cc=%T/move-multiple-classes/new_multiple_class_test.cpp -new_header=%T/move-multiple-classes/new_multiple_class_test.h -old_cc=%T/move-multiple-classes/multiple_class_test.cpp -old_header=../move-multiple-classes/multiple_class_test.h -dump_result %T/move-multiple-classes/multiple_class_test.cpp -- -std=c++11| FileCheck %s -check-prefix=CHECK-EMPTY |
5 | // RUN: clang-move -names="a::Move1, b::Move2,c::Move3,c::Move4,c::EnclosingMove5" -new_cc=%T/move-multiple-classes/new_multiple_class_test.cpp -new_header=%T/move-multiple-classes/new_multiple_class_test.h -old_cc=%T/move-multiple-classes/multiple_class_test.cpp -old_header=../move-multiple-classes/multiple_class_test.h %T/move-multiple-classes/multiple_class_test.cpp -- -std=c++11 |
6 | // RUN: FileCheck -input-file=%T/move-multiple-classes/new_multiple_class_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s |
7 | // RUN: FileCheck -input-file=%T/move-multiple-classes/new_multiple_class_test.h -check-prefix=CHECK-NEW-TEST-H %s |
8 | // RUN: FileCheck -input-file=%T/move-multiple-classes/multiple_class_test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s |
9 | // RUN: FileCheck -input-file=%T/move-multiple-classes/multiple_class_test.h -check-prefix=CHECK-OLD-TEST-H %s |
10 | // |
11 | // CHECK-EMPTY: [{{[[:space:]]*}}] |
12 | // |
13 | // CHECK-OLD-TEST-H: namespace c { |
14 | // CHECK-OLD-TEST-H: class NoMove { |
15 | // CHECK-OLD-TEST-H: public: |
16 | // CHECK-OLD-TEST-H: int f(); |
17 | // CHECK-OLD-TEST-H: }; |
18 | // CHECK-OLD-TEST-H: } // namespace c |
19 | |
20 | // CHECK-OLD-TEST-CPP: #include "{{.*}}multiple_class_test.h" |
21 | // CHECK-OLD-TEST-CPP: using a::Move1; |
22 | // CHECK-OLD-TEST-CPP: using namespace a; |
23 | // CHECK-OLD-TEST-CPP: using A = a::Move1; |
24 | // CHECK-OLD-TEST-CPP: static int g = 0; |
25 | // CHECK-OLD-TEST-CPP: namespace { |
26 | // CHECK-OLD-TEST-CPP: using a::Move1; |
27 | // CHECK-OLD-TEST-CPP: using namespace a; |
28 | // CHECK-OLD-TEST-CPP: } // namespace |
29 | // CHECK-OLD-TEST-CPP: namespace b { |
30 | // CHECK-OLD-TEST-CPP: using a::Move1; |
31 | // CHECK-OLD-TEST-CPP: using namespace a; |
32 | // CHECK-OLD-TEST-CPP: using T = a::Move1; |
33 | // CHECK-OLD-TEST-CPP: } // namespace b |
34 | // CHECK-OLD-TEST-CPP: namespace c { |
35 | // CHECK-OLD-TEST-CPP: int NoMove::f() { |
36 | // CHECK-OLD-TEST-CPP: static int F = 0; |
37 | // CHECK-OLD-TEST-CPP: return g; |
38 | // CHECK-OLD-TEST-CPP: } |
39 | // CHECK-OLD-TEST-CPP: } // namespace c |
40 | |
41 | // CHECK-NEW-TEST-H: #ifndef {{.*}}NEW_MULTIPLE_CLASS_TEST_H |
42 | // CHECK-NEW-TEST-H: #define {{.*}}NEW_MULTIPLE_CLASS_TEST_H |
43 | // CHECK-NEW-TEST-H: namespace a { |
44 | // CHECK-NEW-TEST-H: class Move1 { |
45 | // CHECK-NEW-TEST-H: public: |
46 | // CHECK-NEW-TEST-H: int f(); |
47 | // CHECK-NEW-TEST-H: }; |
48 | // CHECK-NEW-TEST-H: } // namespace a |
49 | // CHECK-NEW-TEST-H: namespace b { |
50 | // CHECK-NEW-TEST-H: class Move2 { |
51 | // CHECK-NEW-TEST-H: public: |
52 | // CHECK-NEW-TEST-H: int f(); |
53 | // CHECK-NEW-TEST-H: }; |
54 | // CHECK-NEW-TEST-H: } // namespace b |
55 | // CHECK-NEW-TEST-H: namespace c { |
56 | // CHECK-NEW-TEST-H: class Move3 { |
57 | // CHECK-NEW-TEST-H: public: |
58 | // CHECK-NEW-TEST-H: int f(); |
59 | // CHECK-NEW-TEST-H: }; |
60 | // CHECK-NEW-TEST-H: class Move4 { |
61 | // CHECK-NEW-TEST-H: public: |
62 | // CHECK-NEW-TEST-H: int f(); |
63 | // CHECK-NEW-TEST-H: }; |
64 | // CHECK-NEW-TEST-H: class EnclosingMove5 { |
65 | // CHECK-NEW-TEST-H: public: |
66 | // CHECK-NEW-TEST-H: class Nested { |
67 | // CHECK-NEW-TEST-H: int f(); |
68 | // CHECK-NEW-TEST-H: static int b; |
69 | // CHECK-NEW-TEST-H: }; |
70 | // CHECK-NEW-TEST-H: static int a; |
71 | // CHECK-NEW-TEST-H: }; |
72 | // CHECK-NEW-TEST-H: } // namespace c |
73 | // CHECK-NEW-TEST-H: #endif // {{.*}}NEW_MULTIPLE_CLASS_TEST_H |
74 | |
75 | // CHECK-NEW-TEST-CPP: #include "{{.*}}new_multiple_class_test.h" |
76 | // CHECK-NEW-TEST-CPP: using a::Move1; |
77 | // CHECK-NEW-TEST-CPP: using namespace a; |
78 | // CHECK-NEW-TEST-CPP: using A = a::Move1; |
79 | // CHECK-NEW-TEST-CPP: static int g = 0; |
80 | // CHECK-NEW-TEST-CPP: namespace a { |
81 | // CHECK-NEW-TEST-CPP: int Move1::f() { return 0; } |
82 | // CHECK-NEW-TEST-CPP: } // namespace a |
83 | // CHECK-NEW-TEST-CPP: namespace { |
84 | // CHECK-NEW-TEST-CPP: using a::Move1; |
85 | // CHECK-NEW-TEST-CPP: using namespace a; |
86 | // CHECK-NEW-TEST-CPP: static int k = 0; |
87 | // CHECK-NEW-TEST-CPP: } // namespace |
88 | // CHECK-NEW-TEST-CPP: namespace b { |
89 | // CHECK-NEW-TEST-CPP: using a::Move1; |
90 | // CHECK-NEW-TEST-CPP: using namespace a; |
91 | // CHECK-NEW-TEST-CPP: using T = a::Move1; |
92 | // CHECK-NEW-TEST-CPP: int Move2::f() { return 0; } |
93 | // CHECK-NEW-TEST-CPP: } // namespace b |
94 | // CHECK-NEW-TEST-CPP: namespace c { |
95 | // CHECK-NEW-TEST-CPP: int Move3::f() { |
96 | // CHECK-NEW-TEST-CPP: using a::Move1; |
97 | // CHECK-NEW-TEST-CPP: using namespace b; |
98 | // CHECK-NEW-TEST-CPP: return 0; |
99 | // CHECK-NEW-TEST-CPP: } |
100 | // CHECK-NEW-TEST-CPP: int Move4::f() { return k; } |
101 | // CHECK-NEW-TEST-CPP: int EnclosingMove5::a = 1; |
102 | // CHECK-NEW-TEST-CPP: int EnclosingMove5::Nested::f() { return g; } |
103 | // CHECK-NEW-TEST-CPP: int EnclosingMove5::Nested::b = 1; |
104 | // CHECK-NEW-TEST-CPP: } // namespace c |
105 | |