1// RUN: mkdir -p %T/move-type-alias
2// RUN: cp %S/Inputs/type_alias.h %T/move-type-alias/type_alias.h
3// RUN: echo '#include "type_alias.h"' > %T/move-type-alias/type_alias.cpp
4// RUN: cd %T/move-type-alias
5//
6// -----------------------------------------------------------------------------
7// Test moving typedef declarations.
8// -----------------------------------------------------------------------------
9// RUN: clang-move -names="Int1" -new_cc=%T/move-type-alias/new_test.cpp -new_header=%T/move-type-alias/new_test.h -old_cc=%T/move-type-alias/type_alias.cpp -old_header=%T/move-type-alias/type_alias.h %T/move-type-alias/type_alias.cpp -- -std=c++11
10// RUN: FileCheck -input-file=%T/move-type-alias/new_test.h -check-prefix=CHECK-NEW-TEST-H-CASE1 %s
11// RUN: FileCheck -input-file=%T/move-type-alias/type_alias.h -check-prefix=CHECK-OLD-TEST-H-CASE1 %s
12
13// CHECK-NEW-TEST-H-CASE1: typedef int Int1;
14
15// CHECK-OLD-TEST-H-CASE1-NOT: typedef int Int1;
16
17
18// -----------------------------------------------------------------------------
19// Test moving type alias declarations.
20// -----------------------------------------------------------------------------
21// RUN: cp %S/Inputs/type_alias.h %T/move-type-alias/type_alias.h
22// RUN: echo '#include "type_alias.h"' > %T/move-type-alias/type_alias.cpp
23// RUN: clang-move -names="Int2" -new_cc=%T/move-type-alias/new_test.cpp -new_header=%T/move-type-alias/new_test.h -old_cc=%T/move-type-alias/type_alias.cpp -old_header=%T/move-type-alias/type_alias.h %T/move-type-alias/type_alias.cpp -- -std=c++11
24// RUN: FileCheck -input-file=%T/move-type-alias/new_test.h -check-prefix=CHECK-NEW-TEST-H-CASE2 %s
25// RUN: FileCheck -input-file=%T/move-type-alias/type_alias.h -check-prefix=CHECK-OLD-TEST-H-CASE2 %s
26
27// CHECK-NEW-TEST-H-CASE2: using Int2 = int;
28
29// CHECK-OLD-TEST-H-CASE2-NOT: using Int2 = int;
30
31
32// -----------------------------------------------------------------------------
33// Test moving template type alias declarations.
34// -----------------------------------------------------------------------------
35// RUN: cp %S/Inputs/type_alias.h %T/move-type-alias/type_alias.h
36// RUN: echo '#include "type_alias.h"' > %T/move-type-alias/type_alias.cpp
37// RUN: clang-move -names="B" -new_cc=%T/move-type-alias/new_test.cpp -new_header=%T/move-type-alias/new_test.h -old_cc=%T/move-type-alias/type_alias.cpp -old_header=%T/move-type-alias/type_alias.h %T/move-type-alias/type_alias.cpp -- -std=c++11
38// RUN: FileCheck -input-file=%T/move-type-alias/new_test.h -check-prefix=CHECK-OLD-TEST-H-CASE3 %s
39
40// CHECK-NEW-TEST-H-CASE3: template<class T> using B = A<T>;
41// CHECK-OLD-TEST-H-CASE3-NOT: template<class T> using B = A<T>;
42
43
44// -----------------------------------------------------------------------------
45// Test not moving class-insided typedef declarations.
46// -----------------------------------------------------------------------------
47// RUN: cp %S/Inputs/type_alias.h %T/move-type-alias/type_alias.h
48// RUN: echo '#include "type_alias.h"' > %T/move-type-alias/type_alias.cpp
49// RUN: clang-move -names="C::Int3" -new_cc=%T/move-type-alias/new_test.cpp -new_header=%T/move-type-alias/new_test.h -old_cc=%T/move-type-alias/type_alias.cpp -old_header=%T/move-type-alias/type_alias.h %T/move-type-alias/type_alias.cpp -- -std=c++11
50// RUN: FileCheck -input-file=%T/move-type-alias/new_test.h -allow-empty -check-prefix=CHECK-EMPTY %s
51
52// CHECK-EMPTY: {{^}}{{$}}
53

source code of clang-tools-extra/test/clang-move/move-type-alias.cpp