summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-rename/Variable.cpp
diff options
context:
space:
mode:
authorKirill Bobyrev <omtcyfz@gmail.com>2016-07-15 12:22:38 +0000
committerKirill Bobyrev <omtcyfz@gmail.com>2016-07-15 12:22:38 +0000
commitee99fd13ae7db929b9ba3d4510f939d51af50e62 (patch)
tree5ac2a4a98d8e8a3d92fa48190259b790c45f239b /clang-tools-extra/test/clang-rename/Variable.cpp
parent9377a7b6a811cd0d55c100cc693ea6f46ceeac75 (diff)
downloadbcm5719-llvm-ee99fd13ae7db929b9ba3d4510f939d51af50e62.tar.gz
bcm5719-llvm-ee99fd13ae7db929b9ba3d4510f939d51af50e62.zip
[clang-rename] fix testset
Make yet unsupported tests marked with FIXME pass so that buildbot doesn't fail. llvm-svn: 275556
Diffstat (limited to 'clang-tools-extra/test/clang-rename/Variable.cpp')
-rw-r--r--clang-tools-extra/test/clang-rename/Variable.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-rename/Variable.cpp b/clang-tools-extra/test/clang-rename/Variable.cpp
new file mode 100644
index 00000000000..02935bdb360
--- /dev/null
+++ b/clang-tools-extra/test/clang-rename/Variable.cpp
@@ -0,0 +1,27 @@
+// RUN: cat %s > %t.cpp
+// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i --
+// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
+
+namespace A {
+int Foo; // CHECK: int Bar;
+}
+int Foo; // CHECK: int Foo;
+int Qux = Foo; // CHECK: int Qux = Foo;
+int Baz = A::Foo; // CHECK: Baz = A::Bar;
+void fun() {
+ struct {
+ int Foo; // CHECK: int Foo;
+ } b = {100};
+ int Foo = 100; // CHECK: int Foo = 100;
+ Baz = Foo; // CHECK: Baz = Foo;
+ {
+ extern int Foo; // CHECK: extern int Foo;
+ Baz = Foo; // CHECK: Baz = Foo;
+ Foo = A::Foo + Baz; // CHECK: Foo = A::Bar + Baz;
+ A::Foo = b.Foo; // CHECK: A::Bar = b.Foo;
+ }
+ Foo = b.Foo; // Foo = b.Foo;
+}
+
+// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when changing
+// this file.
OpenPOWER on IntegriCloud