brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 5fb0258 Raw
44 lines · cpp
1// RUN: mkdir -p %t.dir/clang-move/build2// RUN: mkdir -p %t.dir/clang-move/include3// RUN: mkdir -p %t.dir/clang-move/src4// RUN: sed 's|$test_dir|%/t.dir/clang-move|g' %S/Inputs/database_template.json > %t.dir/clang-move/compile_commands.json5// RUN: cp %S/Inputs/test.h  %t.dir/clang-move/include6// RUN: cp %S/Inputs/test.cpp %t.dir/clang-move/src7// RUN: touch %t.dir/clang-move/include/test2.h8// RUN: cd %t.dir/clang-move/build9// RUN: clang-move -names="a::Foo" -new_cc=%t.dir/clang-move/new_test.cpp -new_header=%t.dir/clang-move/new_test.h -old_cc=../src/test.cpp -old_header=../include/test.h %t.dir/clang-move/src/test.cpp10// RUN: FileCheck -input-file=%t.dir/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s11// RUN: FileCheck -input-file=%t.dir/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s12// RUN: FileCheck -input-file=%t.dir/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s13// RUN: FileCheck -input-file=%t.dir/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s14//15// RUN: cp %S/Inputs/test.h  %t.dir/clang-move/include16// RUN: cp %S/Inputs/test.cpp %t.dir/clang-move/src17// RUN: cd %t.dir/clang-move/build18// RUN: clang-move -names="a::Foo" -new_cc=%t.dir/clang-move/new_test.cpp -new_header=%t.dir/clang-move/new_test.h -old_cc=%t.dir/clang-move/src/test.cpp -old_header=%t.dir/clang-move/include/test.h %t.dir/clang-move/src/test.cpp19// RUN: FileCheck -input-file=%t.dir/clang-move/new_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s20// RUN: FileCheck -input-file=%t.dir/clang-move/new_test.h -check-prefix=CHECK-NEW-TEST-H %s21// RUN: FileCheck -input-file=%t.dir/clang-move/src/test.cpp -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s22// RUN: FileCheck -input-file=%t.dir/clang-move/include/test.h -check-prefix=CHECK-OLD-TEST-EMPTY -allow-empty %s23//24//25// CHECK-NEW-TEST-H: #ifndef TEST_H // comment 126// CHECK-NEW-TEST-H: #define TEST_H27// CHECK-NEW-TEST-H: namespace a {28// CHECK-NEW-TEST-H: class Foo {29// CHECK-NEW-TEST-H: public:30// CHECK-NEW-TEST-H:   int f();31// CHECK-NEW-TEST-H:   int f2(int a, int b);32// CHECK-NEW-TEST-H: };33// CHECK-NEW-TEST-H: } // namespace a34// CHECK-NEW-TEST-H: #endif // TEST_H35//36// CHECK-NEW-TEST-CPP: #include "{{.*}}new_test.h"37// CHECK-NEW-TEST-CPP: #include "test2.h"38// CHECK-NEW-TEST-CPP: namespace a {39// CHECK-NEW-TEST-CPP: int Foo::f() { return 0; }40// CHECK-NEW-TEST-CPP: int Foo::f2(int a, int b) { return a + b; }41// CHECK-NEW-TEST-CPP: } // namespace a42//43// CHECK-OLD-TEST-EMPTY: {{^}}{{$}}44