brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · a52d55c Raw
71 lines · cpp
1// RUN: mkdir -p %t.dir/move-function2// RUN: cat %S/Inputs/function_test.h > %t.dir/move-function/function_test.h3// RUN: cat %S/Inputs/function_test.cpp > %t.dir/move-function/function_test.cpp4// RUN: cd %t.dir/move-function5// RUN: clang-move -names="g" -new_header=%t.dir/move-function/new_function_test.h -old_header=../move-function/function_test.h %t.dir/move-function/function_test.cpp --6// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.h -check-prefix=CHECK-NEW-TEST-H-CASE1 %s7//8// CHECK-NEW-TEST-H-CASE1: #ifndef {{.*}}NEW_FUNCTION_TEST_H9// CHECK-NEW-TEST-H-CASE1: #define {{.*}}NEW_FUNCTION_TEST_H10// CHECK-NEW-TEST-H-CASE1: {{[[:space:]]+}}11// CHECK-NEW-TEST-H-CASE1: inline int g() { return 0; }12// CHECK-NEW-TEST-H-CASE1: {{[[:space:]]+}}13// CHECK-NEW-TEST-H-CASE1: #endif // {{.*}}NEW_FUNCTION_TEST_H14//15// RUN: cp %S/Inputs/function_test*  %t.dir/move-function16// RUN: clang-move -names="h" -new_header=%t.dir/move-function/new_function_test.h -old_header=../move-function/function_test.h %t.dir/move-function/function_test.cpp --17// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.h -check-prefix=CHECK-NEW-TEST-H-CASE2 %s18//19// CHECK-NEW-TEST-H-CASE2: #ifndef {{.*}}NEW_FUNCTION_TEST_H20// CHECK-NEW-TEST-H-CASE2: #define {{.*}}NEW_FUNCTION_TEST_H21// CHECK-NEW-TEST-H-CASE2: {{[[:space:]]+}}22// CHECK-NEW-TEST-H-CASE2: template <typename T> void h(T t) {}23// CHECK-NEW-TEST-H-CASE2: {{[[:space:]]+}}24// CHECK-NEW-TEST-H-CASE2: template <> void h(int t) {}25// CHECK-NEW-TEST-H-CASE2: {{[[:space:]]+}}26// CHECK-NEW-TEST-H-CASE2: #endif // {{.*}}NEW_FUNCTION_TEST_H27//28// RUN: cp %S/Inputs/function_test*  %t.dir/move-function29// RUN: clang-move -names="f" -new_header=%t.dir/move-function/new_function_test.h -new_cc=%t.dir/move-function/new_function_test.cpp -old_header=../move-function/function_test.h -old_cc=../move-function/function_test.cpp %t.dir/move-function/function_test.cpp --30// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.h -check-prefix=CHECK-NEW-TEST-H-CASE3 %s31// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.cpp -check-prefix=CHECK-NEW-TEST-CPP-CASE3 %s32//33// CHECK-NEW-TEST-H-CASE3: #ifndef {{.*}}NEW_FUNCTION_TEST_H34// CHECK-NEW-TEST-H-CASE3: #define {{.*}}NEW_FUNCTION_TEST_H35// CHECK-NEW-TEST-H-CASE3: {{[[:space:]]+}}36// CHECK-NEW-TEST-H-CASE3: void f();37// CHECK-NEW-TEST-H-CASE3: {{[[:space:]]+}}38// CHECK-NEW-TEST-H-CASE3: #endif // {{.*}}NEW_FUNCTION_TEST_H39// CHECK-NEW-TEST-CPP-CASE3: #include "{{.*}}new_function_test.h"40// CHECK-NEW-TEST-CPP-CASE3: {{[[:space:]]+}}41// CHECK-NEW-TEST-CPP-CASE3: void f() {}42//43// RUN: cat %S/Inputs/function_test.h > %t.dir/move-function/function_test.h44// RUN: cat %S/Inputs/function_test.cpp > %t.dir/move-function/function_test.cpp45// RUN: clang-move -names="A::f" -new_header=%t.dir/move-function/new_function_test.h -new_cc=%t.dir/move-function/new_function_test.cpp -old_header=../move-function/function_test.h -old_cc=../move-function/function_test.cpp %t.dir/move-function/function_test.cpp -dump_result -- | FileCheck %s -check-prefix=CHECK-EMPTY46//47// CHECK-EMPTY: [{{[[:space:]]*}}]48//49// RUN: cat %S/Inputs/function_test.h > %t.dir/move-function/function_test.h50// RUN: cat %S/Inputs/function_test.cpp > %t.dir/move-function/function_test.cpp51// RUN: clang-move -names="f,A" -new_header=%t.dir/move-function/new_function_test.h -new_cc=%t.dir/move-function/new_function_test.cpp -old_header=../move-function/function_test.h -old_cc=../move-function/function_test.cpp %t.dir/move-function/function_test.cpp --52// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.h -check-prefix=CHECK-NEW-TEST-H-CASE4 %s53// RUN: FileCheck -input-file=%t.dir/move-function/new_function_test.cpp -check-prefix=CHECK-NEW-TEST-CPP-CASE4 %s54 55// CHECK-NEW-TEST-H-CASE4: #ifndef {{.*}}NEW_FUNCTION_TEST_H56// CHECK-NEW-TEST-H-CASE4: #define {{.*}}NEW_FUNCTION_TEST_H57// CHECK-NEW-TEST-H-CASE4: {{[[:space:]]+}}58// CHECK-NEW-TEST-H-CASE4: void f();59// CHECK-NEW-TEST-H-CASE4: {{[[:space:]]+}}60// CHECK-NEW-TEST-H-CASE4: class A {61// CHECK-NEW-TEST-H-CASE4: public:62// CHECK-NEW-TEST-H-CASE4:   void f();63// CHECK-NEW-TEST-H-CASE4: };64// CHECK-NEW-TEST-H-CASE4: {{[[:space:]]+}}65// CHECK-NEW-TEST-H-CASE4: #endif // {{.*}}NEW_FUNCTION_TEST_H66// CHECK-NEW-TEST-CPP-CASE4: #include "{{.*}}new_function_test.h"67// CHECK-NEW-TEST-CPP-CASE4: {{[[:space:]]+}}68// CHECK-NEW-TEST-CPP-CASE4: void f() {}69// CHECK-NEW-TEST-CPP-CASE4: {{[[:space:]]+}}70// CHECK-NEW-TEST-CPP-CASE4: void A::f() {}71