[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / test / clang-move / no-move-macro-helpers.cpp
blob282eee010032dd43e96b71e56c8e82fde0a0329f
1 // RUN: mkdir -p %T/no-move-macro-helper
2 // RUN: cat %S/Inputs/macro_helper_test.h > %T/no-move-macro-helper/macro_helper_test.h
3 // RUN: cat %S/Inputs/macro_helper_test.cpp > %T/no-move-macro-helper/macro_helper_test.cpp
4 // RUN: cd %T/no-move-macro-helper
5 //
6 // -----------------------------------------------------------------------------
7 // Test no moving helpers in macro.
8 // -----------------------------------------------------------------------------
9 // RUN: clang-move -names="A" -new_cc=%T/no-move-macro-helper/new_test.cpp -new_header=%T/no-move-macro-helper/new_test.h -old_cc=%T/no-move-macro-helper/macro_helper_test.cpp -old_header=%T/no-move-macro-helper/macro_helper_test.h %T/no-move-macro-helper/macro_helper_test.cpp -- -std=c++11
10 // RUN: FileCheck -input-file=%T/no-move-macro-helper/new_test.h -check-prefix=CHECK-NEW-TEST-CASE1-H %s
11 // RUN: FileCheck -input-file=%T/no-move-macro-helper/new_test.cpp -check-prefix=CHECK-NEW-TEST-CASE1-CPP %s
12 // RUN: FileCheck -input-file=%T/no-move-macro-helper/macro_helper_test.h -check-prefix=CHECK-OLD-TEST-CASE1-H %s
13 // RUN: FileCheck -input-file=%T/no-move-macro-helper/macro_helper_test.cpp -check-prefix=CHECK-OLD-TEST-CASE1-CPP %s
15 // CHECK-NEW-TEST-CASE1-H: class A {};
17 // CHECK-OLD-TEST-CASE1-H-NOT: class A {};
19 // CHECK-OLD-TEST-CASE1-CPP: DEFINE(test)
21 // CHECK-NEW-TEST-CASE1-CPP-NOT: DEFINE(test)
24 // -----------------------------------------------------------------------------
25 // Test moving all.
26 // -----------------------------------------------------------------------------
27 // RUN: cat %S/Inputs/macro_helper_test.h > %T/no-move-macro-helper/macro_helper_test.h
28 // RUN: cat %S/Inputs/macro_helper_test.cpp > %T/no-move-macro-helper/macro_helper_test.cpp
29 // RUN: clang-move -names="A, f1" -new_cc=%T/no-move-macro-helper/new_test.cpp -new_header=%T/no-move-macro-helper/new_test.h -old_cc=%T/no-move-macro-helper/macro_helper_test.cpp -old_header=%T/no-move-macro-helper/macro_helper_test.h %T/no-move-macro-helper/macro_helper_test.cpp -- -std=c++11
31 // RUN: FileCheck -input-file=%T/no-move-macro-helper/new_test.h -check-prefix=CHECK-NEW-TEST-CASE2-H %s
32 // RUN: FileCheck -input-file=%T/no-move-macro-helper/new_test.cpp -check-prefix=CHECK-NEW-TEST-CASE2-CPP %s
33 // RUN: FileCheck -input-file=%T/no-move-macro-helper/macro_helper_test.h -allow-empty -check-prefix=CHECK-EMPTY %s
34 // RUN: FileCheck -input-file=%T/no-move-macro-helper/macro_helper_test.cpp -allow-empty -check-prefix=CHECK-EMPTY %s
36 // CHECK-NEW-TEST-CASE2-H: class A {};
37 // CHECK-NEW-TEST-CASE2-H-NEXT:void f1();
40 // CHECK-NEW-TEST-CASE2-CPP: DEFINE(test)
41 // CHECK-NEW-TEST-CASE2-CPP: void f1() {}
43 // CHECK-EMPTY: {{^}}{{$}}