1// RUN: cp %S/macro.cpp %T/macro.cpp
2// RUN: echo "#define USING using na::nc::X" > %T/macro.h
3//
4// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern "macro.cpp$" --i %T/macro.cpp --
5// RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s
6// RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-HEADER %s
7//
8// RUN: cp %S/macro.cpp %T/macro.cpp
9// RUN: echo "#define USING using na::nc::X" > %T/macro.h
10// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" --i %T/macro.cpp --
11// RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s
12// RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-CHANGED-HEADER %s
13#include "macro.h"
14namespace na { namespace nc { class X{}; } }
15
16namespace na {
17namespace nb {
18USING;
19}
20}
21// CHECK-CC: namespace x {
22// CHECK-CC: namespace y {
23// CHECK-CC: USING;
24// CHECK-CC: } // namespace y
25// CHECK-CC: } // namespace x
26
27// CHECK-HEADER: #define USING using na::nc::X
28
29// CHECK-CHANGED-HEADER: #define USING using ::na::nc::X
30

source code of clang-tools-extra/test/clang-change-namespace/macro.cpp