summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-rename/Field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-rename/Field.cpp')
-rw-r--r--clang-tools-extra/test/clang-rename/Field.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/clang-tools-extra/test/clang-rename/Field.cpp b/clang-tools-extra/test/clang-rename/Field.cpp
index 217955852b2..c0e9a019e47 100644
--- a/clang-tools-extra/test/clang-rename/Field.cpp
+++ b/clang-tools-extra/test/clang-rename/Field.cpp
@@ -1,14 +1,15 @@
-// RUN: cat %s > %t.cpp
-// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i --
-// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
-
class Baz {
- int Foo; // CHECK: Bar;
+ int Foo; /* Test 1 */ // CHECK: int Bar;
public:
Baz();
};
-Baz::Baz() : Foo(0) {} // CHECK: Baz::Baz() : Bar(0) {}
+Baz::Baz() : Foo(0) /* Test 2 */ {} // CHECK: Baz::Baz() : Bar(0)
+
+// Test 1.
+// RUN: clang-rename -offset=18 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-rename -offset=89 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when changing
-// this file.
+// To find offsets after modifying the file, use:
+// grep -Ubo 'Foo.*' <file>
OpenPOWER on IntegriCloud