xref: /llvm-project/clang-tools-extra/test/clang-change-namespace/macro.cpp (revision 82f6ae5433cac1ba0d02e8df253da3d3b3ce68e1)
15f5a7458SNico Weber // RUN: cp %S/macro.cpp %T/macro.cpp
25f5a7458SNico Weber // RUN: echo "#define USING using na::nc::X" > %T/macro.h
35f5a7458SNico Weber //
4*82f6ae54SKadir Cetinkaya // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern "macro.cpp$" --i %T/macro.cpp --
55f5a7458SNico Weber // RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s
65f5a7458SNico Weber // RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-HEADER %s
75f5a7458SNico Weber //
85f5a7458SNico Weber // RUN: cp %S/macro.cpp %T/macro.cpp
95f5a7458SNico Weber // RUN: echo "#define USING using na::nc::X" > %T/macro.h
105f5a7458SNico Weber // RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" --i %T/macro.cpp --
115f5a7458SNico Weber // RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s
125f5a7458SNico Weber // RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-CHANGED-HEADER %s
135f5a7458SNico Weber #include "macro.h"
145f5a7458SNico Weber namespace na { namespace nc { class X{}; } }
155f5a7458SNico Weber 
165f5a7458SNico Weber namespace na {
175f5a7458SNico Weber namespace nb {
185f5a7458SNico Weber USING;
195f5a7458SNico Weber }
205f5a7458SNico Weber }
215f5a7458SNico Weber // CHECK-CC: namespace x {
225f5a7458SNico Weber // CHECK-CC: namespace y {
235f5a7458SNico Weber // CHECK-CC: USING;
245f5a7458SNico Weber // CHECK-CC: } // namespace y
255f5a7458SNico Weber // CHECK-CC: } // namespace x
265f5a7458SNico Weber 
275f5a7458SNico Weber // CHECK-HEADER: #define USING using na::nc::X
285f5a7458SNico Weber 
295f5a7458SNico Weber // CHECK-CHANGED-HEADER: #define USING using ::na::nc::X
30