summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/change-namespace/macro.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2016-12-01 17:25:55 +0000
committerEric Liu <ioeric@google.com>2016-12-01 17:25:55 +0000
commitc265b02bec973ab3bea9311e271d32e9938f36e9 (patch)
treec1acdf911d102449b742683e16379135f20eeaf8 /clang-tools-extra/test/change-namespace/macro.cpp
parentbcf23661d08a6f77d873d2b985b34cc70c9d39e7 (diff)
downloadbcm5719-llvm-c265b02bec973ab3bea9311e271d32e9938f36e9.tar.gz
bcm5719-llvm-c265b02bec973ab3bea9311e271d32e9938f36e9.zip
[change-namespace] don't generate replacements for files that don't match file pattern.
Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27302 llvm-svn: 288376
Diffstat (limited to 'clang-tools-extra/test/change-namespace/macro.cpp')
-rw-r--r--clang-tools-extra/test/change-namespace/macro.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang-tools-extra/test/change-namespace/macro.cpp b/clang-tools-extra/test/change-namespace/macro.cpp
new file mode 100644
index 00000000000..ba47de603da
--- /dev/null
+++ b/clang-tools-extra/test/change-namespace/macro.cpp
@@ -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
OpenPOWER on IntegriCloud