1 // UNSUPPORTED: system-windows 2 // new_test.cpp contains #include of old test.h when running on windows. This is 3 // probably by a bug for path handling in clang-move. 4 // 5 // RUN: mkdir -p %T/clang-move/build 6 // RUN: mkdir -p %T/clang-move/include 7 // RUN: mkdir -p %T/clang-move/src 8 // RUN: sed 's|$test_dir|%/T/clang-move|g' %S/Inputs/database_template.json > %T/clang-move/compile_commands.json 9 // RUN: cp %S/Inputs/test.h %T/clang-move/include 10 // RUN: cp %S/Inputs/test.cpp %T/clang-move/src 11 // RUN: touch %T/clang-move/include/test2.h 12 // RUN: cd %T/clang-move/build 13 // 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 14 // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s 15 // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s 16 // RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s 17 // RUN: FileCheck -input-file=%T/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s 18 // 19 // RUN: cp %S/Inputs/test.h %T/clang-move/include 20 // RUN: cp %S/Inputs/test.cpp %T/clang-move/src 21 // RUN: cd %T/clang-move/build 22 // 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 23 // RUN: FileCheck -input-file=%T/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s 24 // RUN: FileCheck -input-file=%T/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s 25 // RUN: FileCheck -input-file=%T/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s 26 // RUN: FileCheck -input-file=%T/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s 27 // 28 // 29 // CHECK-NEW-TEST-H: #ifndef TEST_H // comment 1 30 // CHECK-NEW-TEST-H: #define TEST_H 31 // CHECK-NEW-TEST-H: namespace a { 32 // CHECK-NEW-TEST-H: class Foo { 33 // CHECK-NEW-TEST-H: public: 34 // CHECK-NEW-TEST-H: int f(); 35 // CHECK-NEW-TEST-H: int f2(int a, int b); 36 // CHECK-NEW-TEST-H: }; 37 // CHECK-NEW-TEST-H: } // namespace a 38 // CHECK-NEW-TEST-H: #endif // TEST_H 39 // 40 // CHECK-NEW-TEST-CPP: #include "{{.*}}new_test.h" 41 // CHECK-NEW-TEST-CPP: #include "test2.h" 42 // CHECK-NEW-TEST-CPP: namespace a { 43 // CHECK-NEW-TEST-CPP: int Foo::f() { return 0; } 44 // CHECK-NEW-TEST-CPP: int Foo::f2(int a, int b) { return a + b; } 45 // CHECK-NEW-TEST-CPP: } // namespace a 46 // 47 // CHECK-OLD-TEST-EMPTY: {{^}}{{$}} 48