-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[change-namespace] don't generate replacements for files that don't m…
…atch file pattern. Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27302 llvm-svn: 288376
- Loading branch information
Eric Liu
committed
Dec 1, 2016
1 parent
bcf2366
commit c265b02
Showing
3 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// RUN: cp %S/macro.cpp %T/macro.cpp | ||
// RUN: echo "#define USING using na::nc::X" > %T/macro.h | ||
// | ||
// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern "macro.cpp" --i %T/macro.cpp -- | ||
// RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s | ||
// RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-HEADER %s | ||
// | ||
// RUN: cp %S/macro.cpp %T/macro.cpp | ||
// RUN: echo "#define USING using na::nc::X" > %T/macro.h | ||
// RUN: clang-change-namespace -old_namespace "na::nb" -new_namespace "x::y" --file_pattern ".*" --i %T/macro.cpp -- | ||
// RUN: FileCheck -input-file=%T/macro.cpp -check-prefix=CHECK-CC %s | ||
// RUN: FileCheck -input-file=%T/macro.h -check-prefix=CHECK-CHANGED-HEADER %s | ||
#include "macro.h" | ||
namespace na { namespace nc { class X{}; } } | ||
|
||
namespace na { | ||
namespace nb { | ||
USING; | ||
} | ||
} | ||
// CHECK-CC: namespace x { | ||
// CHECK-CC: namespace y { | ||
// CHECK-CC: USING; | ||
// CHECK-CC: } // namespace y | ||
// CHECK-CC: } // namespace x | ||
|
||
// CHECK-HEADER: #define USING using na::nc::X | ||
|
||
// CHECK-CHANGED-HEADER: #define USING using ::na::nc::X |