[clang-rename] add failing test
authorKirill Bobyrev <omtcyfz@gmail.com>
Sun, 4 Sep 2016 22:28:39 +0000 (22:28 +0000)
committerKirill Bobyrev <omtcyfz@gmail.com>
Sun, 4 Sep 2016 22:28:39 +0000 (22:28 +0000)
For some reason clang-rename fails to rename method of templated class. Add
XFAIL test reproducing the issue.

llvm-svn: 280639

clang-tools-extra/test/clang-rename/TemplatedClassFunction.cpp [new file with mode: 0644]

diff --git a/clang-tools-extra/test/clang-rename/TemplatedClassFunction.cpp b/clang-tools-extra/test/clang-rename/TemplatedClassFunction.cpp
new file mode 100644 (file)
index 0000000..1f5b0b5
--- /dev/null
@@ -0,0 +1,22 @@
+template <typename T>
+class A {
+public:
+  void foo() /* Test 1 */ {}  // CHECK: void bar() /* Test 1 */ {}
+};
+
+int main(int argc, char **argv) {
+  A<int> a;
+  a.foo();   /* Test 2 */     // CHECK: a.bar()   /* Test 2 */
+  return 0;
+}
+
+// Test 1.
+// RUN: clang-refactor rename -offset=48 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
+// Test 2.
+// RUN: clang-refactor rename -offset=162 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
+//
+// Currently unsupported test.
+// XFAIL: *
+
+// To find offsets after modifying the file, use:
+//   grep -Ubo 'foo.*' <file>