aboutsummaryrefslogtreecommitdiff
path: root/test/clang-rename/CtorInitializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/clang-rename/CtorInitializer.cpp')
-rw-r--r--test/clang-rename/CtorInitializer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/clang-rename/CtorInitializer.cpp b/test/clang-rename/CtorInitializer.cpp
new file mode 100644
index 000000000000..fed4f5b06c27
--- /dev/null
+++ b/test/clang-rename/CtorInitializer.cpp
@@ -0,0 +1,17 @@
+class Baz {};
+
+class Qux {
+ Baz Foo; /* Test 1 */ // CHECK: Baz Bar;
+public:
+ Qux();
+};
+
+Qux::Qux() : Foo() /* Test 2 */ {} // CHECK: Qux::Qux() : Bar() /* Test 2 */ {}
+
+// Test 1.
+// RUN: clang-rename -offset=33 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-rename -offset=118 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
+
+// To find offsets after modifying the file, use:
+// grep -Ubo 'Foo.*' <file>