[clang] 2733ad2 - [clang-rename] Fix the failure rename test.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 01:07:12 PST 2020


Author: Haojian Wu
Date: 2020-02-11T10:07:00+01:00
New Revision: 2733ad2c244ab33553bbd1aaca4c76907fdd0760

URL: https://github.com/llvm/llvm-project/commit/2733ad2c244ab33553bbd1aaca4c76907fdd0760
DIFF: https://github.com/llvm/llvm-project/commit/2733ad2c244ab33553bbd1aaca4c76907fdd0760.diff

LOG: [clang-rename] Fix the failure rename test.

We cannot run two different tests in a single lit test, split into two.

Added: 
    clang/test/clang-rename/TemplateCtor.cpp

Modified: 
    clang/test/clang-rename/Ctor.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/clang-rename/Ctor.cpp b/clang/test/clang-rename/Ctor.cpp
index 1213cc6a239d..9908a4123ddf 100644
--- a/clang/test/clang-rename/Ctor.cpp
+++ b/clang/test/clang-rename/Ctor.cpp
@@ -5,23 +5,10 @@ class Foo {                   // CHECK: class Bar {
 
 Foo::Foo()  /* Test 2 */ {}   // CHECK: Bar::Bar()  /* Test 2 */ {}
 
-
-class Foo2 { /* Test 3 */     // CHECK: class Bar2 {
-public:
-  template <typename T>
-  Foo2();                     // CHECK: Bar2();
-
-  template <typename T>
-  Foo2(Foo2 &);               // CHECK: Bar2(Bar2 &);
-};
-
-
 // Test 1.
 // RUN: clang-rename -offset=62 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
 // Test 2.
 // RUN: clang-rename -offset=116 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 3.
-// RUN: clang-rename -offset=187 -new-name=Bar2 %s -- | sed 's,//.*,,' | FileCheck %s
 
 // To find offsets after modifying the file, use:
 //   grep -Ubo 'Foo.*' <file>

diff  --git a/clang/test/clang-rename/TemplateCtor.cpp b/clang/test/clang-rename/TemplateCtor.cpp
new file mode 100644
index 000000000000..9a59194ac3f4
--- /dev/null
+++ b/clang/test/clang-rename/TemplateCtor.cpp
@@ -0,0 +1,10 @@
+class Foo { // CHECK: class Bar {
+public:
+  template <typename T>
+  Foo(); // CHECK: Bar();
+
+  template <typename T>
+  Foo(Foo &); // CHECK: Bar(Bar &);
+};
+
+// RUN: clang-rename -offset=6 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s


        


More information about the cfe-commits mailing list