summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-rename/DeclRefExpr.cpp')
-rw-r--r--clang-tools-extra/test/clang-rename/DeclRefExpr.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp b/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp
index 2059ff0b398..6462862d82a 100644
--- a/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp
+++ b/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp
@@ -1,20 +1,24 @@
-// RUN: cat %s > %t.cpp
-// RUN: clang-rename -offset=161 -new-name=Bar %t.cpp -i --
-// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
-
class C {
public:
- static int Foo; // CHECK: static int Bar;
+ static int Foo; /* Test 1 */ // CHECK: static int Bar;
};
int foo(int x) { return 0; }
#define MACRO(a) foo(a)
int main() {
- C::Foo = 1; // CHECK: C::Bar
- MACRO(C::Foo); // CHECK: C::Bar
- int y = C::Foo; // CHECK: C::Bar
+ C::Foo = 1; /* Test 2 */ // CHECK: C::Bar = 1;
+ MACRO(C::Foo); // CHECK: MACRO(C::Bar);
+ int y = C::Foo; /* Test 3 */ // CHECK: int y = C::Bar;
+ return 0;
}
-// Use grep -FUbo 'X' <file> to get the correct offset of foo when changing
-// this file.
+// Test 1.
+// RUN: clang-rename -offset=31 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-rename -offset=152 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 3.
+// RUN: clang-rename -offset=271 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+
+// To find offsets after modifying the file, use:
+// grep -Ubo 'Foo.*' <file>
OpenPOWER on IntegriCloud