From 08c47b37d35c071890a04aae6870711a3831511d Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Mon, 1 Aug 2016 16:48:33 +0000 Subject: [PATCH] [clang-rename] revert r276836 Revert r276836, which resulted in tests passing regardless of the actual tool replacements. llvm-svn: 277354 --- .../clang-rename/ClassAsTemplateArgumentFindByClass.cpp | 4 +++- .../ClassAsTemplateArgumentFindByTemplateArgument.cpp | 4 +++- clang-tools-extra/test/clang-rename/ClassFindByName.cpp | 4 +++- .../test/clang-rename/ClassNameInFunctionDefinition.cpp | 4 +++- .../test/clang-rename/ClassSimpleRenaming.cpp | 6 ++++-- .../test/clang-rename/ComplicatedClassType.cpp | 4 +++- clang-tools-extra/test/clang-rename/ConstCastExpr.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/ConstructExpr.cpp | 6 ++++-- .../test/clang-rename/CtorFindByDeclaration.cpp | 6 ++++-- .../test/clang-rename/CtorFindByDefinition.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/CtorInitializer.cpp | 4 +++- clang-tools-extra/test/clang-rename/DeclRefExpr.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/DtorDeclaration.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/DtorDefinition.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/Field.cpp | 4 +++- clang-tools-extra/test/clang-rename/FunctionMacro.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/MemberExprMacro.cpp | 4 +++- clang-tools-extra/test/clang-rename/Namespace.cpp | 6 ++++-- .../test/clang-rename/ReinterpretCastExpr.cpp | 7 ++++--- clang-tools-extra/test/clang-rename/StaticCastExpr.cpp | 4 +++- .../clang-rename/TemplateFunctionFindByDeclaration.cpp | 4 +++- .../test/clang-rename/TemplateFunctionFindByUse.cpp | 4 +++- .../test/clang-rename/TemplateTypenameFindByTypeInside.cpp | 4 +++- .../UserDefinedConversionFindByTypeDeclaration.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/Variable.cpp | 6 ++++-- clang-tools-extra/test/clang-rename/VariableMacro.cpp | 6 ++++-- 27 files changed, 96 insertions(+), 43 deletions(-) diff --git a/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp b/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp index a75d13c0a243..19015a280132 100644 --- a/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp +++ b/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo {}; // CHECK: class Bar {}; diff --git a/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp b/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp index b95f6fc6d5f0..7fdf911fa417 100644 --- a/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp +++ b/clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=243 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=304 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo {}; // CHECK: class Bar {}; diff --git a/clang-tools-extra/test/clang-rename/ClassFindByName.cpp b/clang-tools-extra/test/clang-rename/ClassFindByName.cpp index 5ec4deab5742..4cd090c1f2f7 100644 --- a/clang-tools-extra/test/clang-rename/ClassFindByName.cpp +++ b/clang-tools-extra/test/clang-rename/ClassFindByName.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -old-name=Foo -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -old-name=Foo -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar }; diff --git a/clang-tools-extra/test/clang-rename/ClassNameInFunctionDefinition.cpp b/clang-tools-extra/test/clang-rename/ClassNameInFunctionDefinition.cpp index 91636faa7191..1b2d59e18623 100644 --- a/clang-tools-extra/test/clang-rename/ClassNameInFunctionDefinition.cpp +++ b/clang-tools-extra/test/clang-rename/ClassNameInFunctionDefinition.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar { public: diff --git a/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp b/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp index 94c5243f0aa7..72710d05de4c 100644 --- a/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp +++ b/clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo {}; // CHECK: class Bar @@ -7,5 +9,5 @@ int main() { return 0; } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Foo' to get the correct offset of Cla when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/ComplicatedClassType.cpp b/clang-tools-extra/test/clang-rename/ComplicatedClassType.cpp index 429c60a3257a..6e888bdb0592 100644 --- a/clang-tools-extra/test/clang-rename/ComplicatedClassType.cpp +++ b/clang-tools-extra/test/clang-rename/ComplicatedClassType.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=159 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=220 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s // Forward declaration. class Foo; // CHECK: class Bar; diff --git a/clang-tools-extra/test/clang-rename/ConstCastExpr.cpp b/clang-tools-extra/test/clang-rename/ConstCastExpr.cpp index 7336a1621d9d..6d6914fad1de 100644 --- a/clang-tools-extra/test/clang-rename/ConstCastExpr.cpp +++ b/clang-tools-extra/test/clang-rename/ConstCastExpr.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar { public: @@ -12,5 +14,5 @@ int main() { const_cast(C)->getValue(); // CHECK: const_cast(C)->getValue(); } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Cla' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/ConstructExpr.cpp b/clang-tools-extra/test/clang-rename/ConstructExpr.cpp index 4c795e2f61d7..d7f104c03d8a 100644 --- a/clang-tools-extra/test/clang-rename/ConstructExpr.cpp +++ b/clang-tools-extra/test/clang-rename/ConstructExpr.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=74 -new-name=Boo %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Boo %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo {}; // CHECK: class Boo {}; @@ -6,5 +8,5 @@ int main() { Foo *C = new Foo(); // CHECK: Boo *C = new Boo(); } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Boo' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/CtorFindByDeclaration.cpp b/clang-tools-extra/test/clang-rename/CtorFindByDeclaration.cpp index d615ba5cc60d..3fb25aedbda1 100644 --- a/clang-tools-extra/test/clang-rename/CtorFindByDeclaration.cpp +++ b/clang-tools-extra/test/clang-rename/CtorFindByDeclaration.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=113 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=174 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar public: @@ -7,5 +9,5 @@ public: Foo::Foo() {} // CHECK: Bar::Bar() -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'C' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/CtorFindByDefinition.cpp b/clang-tools-extra/test/clang-rename/CtorFindByDefinition.cpp index 646d69894bb7..2f7e65c190de 100644 --- a/clang-tools-extra/test/clang-rename/CtorFindByDefinition.cpp +++ b/clang-tools-extra/test/clang-rename/CtorFindByDefinition.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=151 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=212 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar public: @@ -7,5 +9,5 @@ public: Foo::Foo() {} // CHECK: Bar::Bar() -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'C' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/CtorInitializer.cpp b/clang-tools-extra/test/clang-rename/CtorInitializer.cpp index 087cb81cff51..1fa166579505 100644 --- a/clang-tools-extra/test/clang-rename/CtorInitializer.cpp +++ b/clang-tools-extra/test/clang-rename/CtorInitializer.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=102 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=163 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Baz {}; diff --git a/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp b/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp index 0706e07a5e10..2059ff0b3984 100644 --- a/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp +++ b/clang-tools-extra/test/clang-rename/DeclRefExpr.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=100 -new-name=Bar %s -- | FileCheck %s +// 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: @@ -14,5 +16,5 @@ int main() { int y = C::Foo; // CHECK: C::Bar } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'X' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/DtorDeclaration.cpp b/clang-tools-extra/test/clang-rename/DtorDeclaration.cpp index 3a10db0d2eec..239ae57c61e8 100644 --- a/clang-tools-extra/test/clang-rename/DtorDeclaration.cpp +++ b/clang-tools-extra/test/clang-rename/DtorDeclaration.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=114 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=175 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar { public: @@ -8,5 +10,5 @@ public: Foo::~Foo() { // CHECK: Bar::~Bar() } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Bar' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/DtorDefinition.cpp b/clang-tools-extra/test/clang-rename/DtorDefinition.cpp index d3b94023beaf..d81739755a03 100644 --- a/clang-tools-extra/test/clang-rename/DtorDefinition.cpp +++ b/clang-tools-extra/test/clang-rename/DtorDefinition.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=158 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=219 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar { public: @@ -8,5 +10,5 @@ public: Foo::~Foo() {} // CHECK: Bar::~Bar() -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Foo' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp b/clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp index cd3600d464b7..b940dd7dcc03 100644 --- a/clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp +++ b/clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=134 -new-name=Bar %s -- -frtti | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=195 -new-name=Bar %t.cpp -i -- -frtti +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Baz { virtual int getValue() const = 0; @@ -20,5 +22,5 @@ int main() { dynamic_cast(Pointer)->getValue(); // CHECK: dynamic_cast(Pointer)->getValue(); } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Foo' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/Field.cpp b/clang-tools-extra/test/clang-rename/Field.cpp index d7c7e7b9363f..217955852b25 100644 --- a/clang-tools-extra/test/clang-rename/Field.cpp +++ b/clang-tools-extra/test/clang-rename/Field.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=87 -new-name=Bar %s -- | FileCheck %s +// 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; diff --git a/clang-tools-extra/test/clang-rename/FunctionMacro.cpp b/clang-tools-extra/test/clang-rename/FunctionMacro.cpp index 78b93e5ea3b9..1cdac27ab3b1 100644 --- a/clang-tools-extra/test/clang-rename/FunctionMacro.cpp +++ b/clang-tools-extra/test/clang-rename/FunctionMacro.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=138 -new-name=macro_function %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=199 -new-name=macro_function %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s #define moo foo // CHECK: #define moo macro_function @@ -15,5 +17,5 @@ void qoo() { boo(moo()); } -// Use grep -FUbo 'foo' to get the correct offset of foo when changing +// Use grep -FUbo 'foo;' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/MemberExprMacro.cpp b/clang-tools-extra/test/clang-rename/MemberExprMacro.cpp index 96900d55a2c8..24ba05ff83dd 100644 --- a/clang-tools-extra/test/clang-rename/MemberExprMacro.cpp +++ b/clang-tools-extra/test/clang-rename/MemberExprMacro.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=95 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=156 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Baz { public: diff --git a/clang-tools-extra/test/clang-rename/Namespace.cpp b/clang-tools-extra/test/clang-rename/Namespace.cpp index 7933bf549a89..5eea4a60a506 100644 --- a/clang-tools-extra/test/clang-rename/Namespace.cpp +++ b/clang-tools-extra/test/clang-rename/Namespace.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=79 -new-name=llvm %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=143 -new-name=llvm %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s namespace foo { // CHECK: namespace llvm { int x; @@ -8,5 +10,5 @@ void boo() { foo::x = 42; // CHECK: llvm::x = 42; } -// Use grep -FUbo 'foo' to get the correct offset of foo when changing +// Use grep -FUbo 'foo;' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/ReinterpretCastExpr.cpp b/clang-tools-extra/test/clang-rename/ReinterpretCastExpr.cpp index 277e465a97e8..2d5ecd2a014f 100644 --- a/clang-tools-extra/test/clang-rename/ReinterpretCastExpr.cpp +++ b/clang-tools-extra/test/clang-rename/ReinterpretCastExpr.cpp @@ -1,5 +1,6 @@ -// RUN: clang-rename -offset=73 -new-name=X %s -- | FileCheck %s - +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=133 -new-name=X %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Cla { public: int getValue() const { @@ -12,5 +13,5 @@ int main() { reinterpret_cast(C)->getValue(); // CHECK: reinterpret_cast } -// Use grep -FUbo 'Cla' to get the correct offset of Cla when changing +// Use grep -FUbo 'Cla' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/StaticCastExpr.cpp b/clang-tools-extra/test/clang-rename/StaticCastExpr.cpp index c0f43251f993..b75102ab17ee 100644 --- a/clang-tools-extra/test/clang-rename/StaticCastExpr.cpp +++ b/clang-tools-extra/test/clang-rename/StaticCastExpr.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=91 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=152 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Baz { }; diff --git a/clang-tools-extra/test/clang-rename/TemplateFunctionFindByDeclaration.cpp b/clang-tools-extra/test/clang-rename/TemplateFunctionFindByDeclaration.cpp index 24343f09e777..f65290247916 100644 --- a/clang-tools-extra/test/clang-rename/TemplateFunctionFindByDeclaration.cpp +++ b/clang-tools-extra/test/clang-rename/TemplateFunctionFindByDeclaration.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=93 -new-name=bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=154 -new-name=bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s template T foo(T value) { // CHECK: T bar(T value) { diff --git a/clang-tools-extra/test/clang-rename/TemplateFunctionFindByUse.cpp b/clang-tools-extra/test/clang-rename/TemplateFunctionFindByUse.cpp index 7c57062d2588..a3d1717e16b1 100644 --- a/clang-tools-extra/test/clang-rename/TemplateFunctionFindByUse.cpp +++ b/clang-tools-extra/test/clang-rename/TemplateFunctionFindByUse.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=172 -new-name=bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=233 -new-name=bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s template T foo(T value) { // CHECK: T bar(T value) { diff --git a/clang-tools-extra/test/clang-rename/TemplateTypenameFindByTypeInside.cpp b/clang-tools-extra/test/clang-rename/TemplateTypenameFindByTypeInside.cpp index 056bb2a41e3e..a7d822b99a52 100644 --- a/clang-tools-extra/test/clang-rename/TemplateTypenameFindByTypeInside.cpp +++ b/clang-tools-extra/test/clang-rename/TemplateTypenameFindByTypeInside.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=289 -new-name=U %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=350 -new-name=U %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s // Currently unsupported test. // FIXME: clang-rename should be able to rename template parameters correctly. diff --git a/clang-tools-extra/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp b/clang-tools-extra/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp index 2c020e85c9e4..271a5663ae9b 100644 --- a/clang-tools-extra/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp +++ b/clang-tools-extra/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=75 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s class Foo { // CHECK: class Bar { // ^ offset must be here @@ -20,5 +22,5 @@ int main() { return 0; } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Foo' to get the correct offset of Cla when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/Variable.cpp b/clang-tools-extra/test/clang-rename/Variable.cpp index 5d356ff5b218..02935bdb360e 100644 --- a/clang-tools-extra/test/clang-rename/Variable.cpp +++ b/clang-tools-extra/test/clang-rename/Variable.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=87 -new-name=Bar %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s namespace A { int Foo; // CHECK: int Bar; @@ -21,5 +23,5 @@ void fun() { Foo = b.Foo; // Foo = b.Foo; } -// Use grep -FUbo 'Foo' to get the correct offset of Foo when changing +// Use grep -FUbo 'Foo' to get the correct offset of foo when changing // this file. diff --git a/clang-tools-extra/test/clang-rename/VariableMacro.cpp b/clang-tools-extra/test/clang-rename/VariableMacro.cpp index 1b6c7ce099d5..2a0cd870438d 100644 --- a/clang-tools-extra/test/clang-rename/VariableMacro.cpp +++ b/clang-tools-extra/test/clang-rename/VariableMacro.cpp @@ -1,4 +1,6 @@ -// RUN: clang-rename -offset=147 -new-name=Z %s -- | FileCheck %s +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=208 -new-name=Z %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s #define Y X // CHECK: #define Y Z @@ -12,5 +14,5 @@ void macro() { foo(Y); } -// Use grep -FUbo 'X' to get the correct offset of X when changing +// Use grep -FUbo 'foo;' to get the correct offset of foo when changing // this file.