summaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-move
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-10-19 14:13:21 +0000
committerHaojian Wu <hokein@google.com>2016-10-19 14:13:21 +0000
commit91f573a99a2feb9e33439f3ca893319bd98f0101 (patch)
tree6e4593052e07742a77f80ee31a23ad16b748f7bc /clang-tools-extra/test/clang-move
parent4860771069194b815f81d66e44973fba34a5fa5d (diff)
[clang-move] Move using-decl in old cc.
Summary: Another fix is to move the whole anonymous namespace declaration completely instead of moving fun/var declarations only. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25762
Diffstat (limited to 'clang-tools-extra/test/clang-move')
-rw-r--r--clang-tools-extra/test/clang-move/Inputs/multiple_class_test.cpp12
-rw-r--r--clang-tools-extra/test/clang-move/move-multiple-classes.cpp25
2 files changed, 36 insertions, 1 deletions
diff --git a/clang-tools-extra/test/clang-move/Inputs/multiple_class_test.cpp b/clang-tools-extra/test/clang-move/Inputs/multiple_class_test.cpp
index 3e62ea836c1..691cffeb23d 100644
--- a/clang-tools-extra/test/clang-move/Inputs/multiple_class_test.cpp
+++ b/clang-tools-extra/test/clang-move/Inputs/multiple_class_test.cpp
@@ -6,7 +6,16 @@ int Move1::f() {
}
} // namespace a
+namespace {
+using a::Move1;
+using namespace a;
+static int k = 0;
+} // anonymous namespace
+
namespace b {
+using a::Move1;
+using namespace a;
+using T = a::Move1;
int Move2::f() {
return 0;
}
@@ -14,6 +23,8 @@ int Move2::f() {
namespace c {
int Move3::f() {
+ using a::Move1;
+ using namespace b;
return 0;
}
@@ -30,6 +41,7 @@ int EnclosingMove5::Nested::f() {
int EnclosingMove5::Nested::b = 1;
int NoMove::f() {
+ static int F = 0;
return 0;
}
} // namespace c
diff --git a/clang-tools-extra/test/clang-move/move-multiple-classes.cpp b/clang-tools-extra/test/clang-move/move-multiple-classes.cpp
index f33ac752d36..438056ae231 100644
--- a/clang-tools-extra/test/clang-move/move-multiple-classes.cpp
+++ b/clang-tools-extra/test/clang-move/move-multiple-classes.cpp
@@ -18,8 +18,19 @@
// CHECK-OLD-TEST-H: } // namespace c
// CHECK-OLD-TEST-CPP: #include "{{.*}}multiple_class_test.h"
+// CHECK-OLD-TEST-CPP: namespace {
+// CHECK-OLD-TEST-CPP: using a::Move1;
+// CHECK-OLD-TEST-CPP: using namespace a;
+// CHECK-OLD-TEST-CPP: static int k = 0;
+// CHECK-OLD-TEST-CPP: } // anonymous namespace
+// CHECK-OLD-TEST-CPP: namespace b {
+// CHECK-OLD-TEST-CPP: using a::Move1;
+// CHECK-OLD-TEST-CPP: using namespace a;
+// CHECK-OLD-TEST-CPP: using T = a::Move1;
+// CHECK-OLD-TEST-CPP: } // namespace b
// CHECK-OLD-TEST-CPP: namespace c {
// CHECK-OLD-TEST-CPP: int NoMove::f() {
+// CHECK-OLD-TEST-CPP: static int F = 0;
// CHECK-OLD-TEST-CPP: return 0;
// CHECK-OLD-TEST-CPP: }
// CHECK-OLD-TEST-CPP: } // namespace c
@@ -62,11 +73,23 @@
// CHECK-NEW-TEST-CPP: namespace a {
// CHECK-NEW-TEST-CPP: int Move1::f() { return 0; }
// CHECK-NEW-TEST-CPP: } // namespace a
+// CHECK-NEW-TEST-CPP: namespace {
+// CHECK-NEW-TEST-CPP: using a::Move1;
+// CHECK-NEW-TEST-CPP: using namespace a;
+// CHECK-NEW-TEST-CPP: static int k = 0;
+// CHECK-NEW-TEST-CPP: } // anonymous namespace
// CHECK-NEW-TEST-CPP: namespace b {
+// CHECK-NEW-TEST-CPP: using a::Move1;
+// CHECK-NEW-TEST-CPP: using namespace a;
+// CHECK-NEW-TEST-CPP: using T = a::Move1;
// CHECK-NEW-TEST-CPP: int Move2::f() { return 0; }
// CHECK-NEW-TEST-CPP: } // namespace b
// CHECK-NEW-TEST-CPP: namespace c {
-// CHECK-NEW-TEST-CPP: int Move3::f() { return 0; }
+// CHECK-NEW-TEST-CPP: int Move3::f() {
+// CHECK-NEW-TEST-CPP: using a::Move1;
+// CHECK-NEW-TEST-CPP: using namespace b;
+// CHECK-NEW-TEST-CPP: return 0;
+// CHECK-NEW-TEST-CPP: }
// CHECK-NEW-TEST-CPP: int Move4::f() { return 0; }
// CHECK-NEW-TEST-CPP: int EnclosingMove5::a = 1;
// CHECK-NEW-TEST-CPP: int EnclosingMove5::Nested::f() { return 0; }