[clang-tools-extra] r276836 - test: simplify commands, NFC

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 09:36:25 PDT 2016


On Wed, Jul 27, 2016 at 6:43 AM, Saleem Abdulrasool via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: compnerd
> Date: Tue Jul 26 23:43:15 2016
> New Revision: 276836
>
> URL: http://llvm.org/viewvc/llvm-project?rev=276836&view=rev
> Log:
> test: simplify commands, NFC
>
> Rather than copying the file and then doing an in-place edit, perform the
> replacements to stdout and pass the output to FileCheck directly.  Avoids
> unnecessary copying and seds.
>
> Modified:
>
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp
>
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp
>     clang-tools-extra/trunk/test/clang-rename/ClassFindByName.cpp
>
> clang-tools-extra/trunk/test/clang-rename/ClassNameInFunctionDefenition.cpp
>     clang-tools-extra/trunk/test/clang-rename/ClassSimpleRenaming.cpp
>     clang-tools-extra/trunk/test/clang-rename/ComplicatedClassType.cpp
>     clang-tools-extra/trunk/test/clang-rename/ConstCastExpr.cpp
>     clang-tools-extra/trunk/test/clang-rename/ConstructExpr.cpp
>     clang-tools-extra/trunk/test/clang-rename/CtorFindByDeclaration.cpp
>     clang-tools-extra/trunk/test/clang-rename/CtorFindByDefinition.cpp
>     clang-tools-extra/trunk/test/clang-rename/CtorInitializer.cpp
>     clang-tools-extra/trunk/test/clang-rename/DeclRefExpr.cpp
>     clang-tools-extra/trunk/test/clang-rename/DtorDeclaration.cpp
>     clang-tools-extra/trunk/test/clang-rename/DtorDefinition.cpp
>     clang-tools-extra/trunk/test/clang-rename/DynamicCastExpr.cpp
>     clang-tools-extra/trunk/test/clang-rename/Field.cpp
>     clang-tools-extra/trunk/test/clang-rename/FunctionMacro.cpp
>     clang-tools-extra/trunk/test/clang-rename/MemberExprMacro.cpp
>     clang-tools-extra/trunk/test/clang-rename/Namespace.cpp
>     clang-tools-extra/trunk/test/clang-rename/ReinterpretCastExpr.cpp
>     clang-tools-extra/trunk/test/clang-rename/StaticCastExpr.cpp
>
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByDeclaration.cpp
>     clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByUse.cpp
>
> clang-tools-extra/trunk/test/clang-rename/TemplateTypenameFindByTypeInside.cpp
>
> clang-tools-extra/trunk/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp
>     clang-tools-extra/trunk/test/clang-rename/Variable.cpp
>     clang-tools-extra/trunk/test/clang-rename/VariableMacro.cpp
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s
>

This patch changes behavior of the tests. Namely, it makes most tests pass
even if clang-rename doesn't do anything. The reason is that the CHECK
patterns that don't contain regular expressions will match with themselves
(previously, `sed 's,//.*,,` would remove them).

Please revert or fix (or better revert and then post another patch for
review).


>
>  class Foo {};   // CHECK: class Bar {};
>
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=304 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=243 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {};   // CHECK: class Bar {};
>
>
> Modified: clang-tools-extra/trunk/test/clang-rename/ClassFindByName.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ClassFindByName.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ClassFindByName.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ClassFindByName.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -old-name=Foo -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -old-name=Foo -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {         // CHECK: class Bar
>  };
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/ClassNameInFunctionDefenition.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ClassNameInFunctionDefenition.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/ClassNameInFunctionDefenition.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/ClassNameInFunctionDefenition.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {             // CHECK: class Bar {
>  public:
>
> Modified: clang-tools-extra/trunk/test/clang-rename/ClassSimpleRenaming.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ClassSimpleRenaming.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ClassSimpleRenaming.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ClassSimpleRenaming.cpp Tue
> Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {};       // CHECK: class Bar
>
> @@ -9,5 +7,5 @@ int main() {
>    return 0;
>  }
>
> -// Use grep -FUbo 'Foo' <file> to get the correct offset of Cla when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/ComplicatedClassType.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ComplicatedClassType.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ComplicatedClassType.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ComplicatedClassType.cpp Tue
> Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=220 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=159 -new-name=Bar %s -- | FileCheck %s
>
>  // Forward declaration.
>  class Foo;                            // CHECK: class Bar;
>
> Modified: clang-tools-extra/trunk/test/clang-rename/ConstCastExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ConstCastExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ConstCastExpr.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ConstCastExpr.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=74 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {                         // CHECK: class Bar {
>  public:
> @@ -14,5 +12,5 @@ int main() {
>    const_cast<Foo *>(C)->getValue(); // CHECK: const_cast<Bar
> *>(C)->getValue();
>  }
>
> -// Use grep -FUbo 'Cla' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/ConstructExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ConstructExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ConstructExpr.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ConstructExpr.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Boo %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=74 -new-name=Boo %s -- | FileCheck %s
>
>  class Foo {};         // CHECK: class Boo {};
>
> @@ -8,5 +6,5 @@ int main() {
>    Foo *C = new Foo(); // CHECK: Boo *C = new Boo();
>  }
>
> -// Use grep -FUbo 'Boo' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/CtorFindByDeclaration.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/CtorFindByDeclaration.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/CtorFindByDeclaration.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/CtorFindByDeclaration.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=174 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=113 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {   // CHECK: class Bar
>  public:
> @@ -9,5 +7,5 @@ public:
>
>  Foo::Foo() {} // CHECK: Bar::Bar()
>
> -// Use grep -FUbo 'C' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/CtorFindByDefinition.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/CtorFindByDefinition.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/CtorFindByDefinition.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/CtorFindByDefinition.cpp Tue
> Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=212 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=151 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {   // CHECK: class Bar
>  public:
> @@ -9,5 +7,5 @@ public:
>
>  Foo::Foo() {} // CHECK: Bar::Bar()
>
> -// Use grep -FUbo 'C' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/CtorInitializer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/CtorInitializer.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/CtorInitializer.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/CtorInitializer.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=163 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=102 -new-name=Bar %s -- | FileCheck %s
>
>  class Baz {};
>
>
> Modified: clang-tools-extra/trunk/test/clang-rename/DeclRefExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DeclRefExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/DeclRefExpr.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/DeclRefExpr.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=161 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=100 -new-name=Bar %s -- | FileCheck %s
>
>  class C {
>  public:
> @@ -16,5 +14,5 @@ int main() {
>    int y = C::Foo; // CHECK: C::Bar
>  }
>
> -// Use grep -FUbo 'X' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/DtorDeclaration.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DtorDeclaration.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/DtorDeclaration.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/DtorDeclaration.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=175 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=114 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo { // CHECK: class Bar {
>  public:
> @@ -10,5 +8,5 @@ public:
>  Foo::~Foo() { // CHECK: Bar::~Bar()
>  }
>
> -// Use grep -FUbo 'Bar' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/DtorDefinition.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DtorDefinition.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/DtorDefinition.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/DtorDefinition.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=219 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=158 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {     // CHECK: class Bar {
>  public:
> @@ -10,5 +8,5 @@ public:
>  Foo::~Foo() {}  // CHECK: Bar::~Bar()
>
>
> -// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/DynamicCastExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/DynamicCastExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/DynamicCastExpr.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/DynamicCastExpr.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=195 -new-name=Bar %t.cpp -i -- -frtti
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=134 -new-name=Bar %s -- -frtti | FileCheck %s
>
>  class Baz {
>    virtual int getValue() const = 0;
> @@ -22,5 +20,5 @@ int main() {
>    dynamic_cast<const Foo *>(Pointer)->getValue();  // CHECK:
> dynamic_cast<const Bar *>(Pointer)->getValue();
>  }
>
> -// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/Field.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/Field.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/Field.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/Field.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=87 -new-name=Bar %s -- | FileCheck %s
>
>  class Baz {
>    int Foo;              // CHECK: Bar;
>
> Modified: clang-tools-extra/trunk/test/clang-rename/FunctionMacro.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/FunctionMacro.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/FunctionMacro.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/FunctionMacro.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=199 -new-name=macro_function %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=138 -new-name=macro_function %s -- |
> FileCheck %s
>
>  #define moo foo // CHECK: #define moo macro_function
>
> @@ -17,5 +15,5 @@ void qoo() {
>    boo(moo());
>  }
>
> -// Use grep -FUbo 'foo;' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'foo' <file> to get the correct offset of foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/MemberExprMacro.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/MemberExprMacro.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/MemberExprMacro.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/MemberExprMacro.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=156 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=95 -new-name=Bar %s -- | FileCheck %s
>
>  class Baz {
>  public:
>
> Modified: clang-tools-extra/trunk/test/clang-rename/Namespace.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/Namespace.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/Namespace.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/Namespace.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=143 -new-name=llvm %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=79 -new-name=llvm %s -- | FileCheck %s
>
>  namespace foo { // CHECK: namespace llvm {
>    int x;
> @@ -10,5 +8,5 @@ void boo() {
>    foo::x = 42;  // CHECK: llvm::x = 42;
>  }
>
> -// Use grep -FUbo 'foo;' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'foo' <file> to get the correct offset of foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/ReinterpretCastExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/ReinterpretCastExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/ReinterpretCastExpr.cpp
> (original)
> +++ clang-tools-extra/trunk/test/clang-rename/ReinterpretCastExpr.cpp Tue
> Jul 26 23:43:15 2016
> @@ -1,6 +1,5 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=133 -new-name=X %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=73 -new-name=X %s -- | FileCheck %s
> +
>  class Cla {
>  public:
>    int getValue() const {
> @@ -13,5 +12,5 @@ int main() {
>    reinterpret_cast<const Cla *>(C)->getValue(); // CHECK:
> reinterpret_cast<const X *>
>  }
>
> -// Use grep -FUbo 'Cla' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Cla' <file> to get the correct offset of Cla when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/StaticCastExpr.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/StaticCastExpr.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/StaticCastExpr.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/StaticCastExpr.cpp Tue Jul
> 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=152 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=91 -new-name=Bar %s -- | FileCheck %s
>
>  class Baz {
>  };
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByDeclaration.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByDeclaration.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByDeclaration.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByDeclaration.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=154 -new-name=bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=93 -new-name=bar %s -- | FileCheck %s
>
>  template <typename T>
>  T foo(T value) {    // CHECK: T bar(T value) {
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByUse.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByUse.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByUse.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/TemplateFunctionFindByUse.cpp Tue
> Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=233 -new-name=bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=172 -new-name=bar %s -- | FileCheck %s
>
>  template <typename T>
>  T foo(T value) {    // CHECK: T bar(T value) {
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/TemplateTypenameFindByTypeInside.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/TemplateTypenameFindByTypeInside.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/TemplateTypenameFindByTypeInside.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/TemplateTypenameFindByTypeInside.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=350 -new-name=U %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=289 -new-name=U %s -- | FileCheck %s
>
>  // Currently unsupported test.
>  // FIXME: clang-rename should be able to rename template parameters
> correctly.
>
> Modified:
> clang-tools-extra/trunk/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp
> Tue Jul 26 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=136 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=75 -new-name=Bar %s -- | FileCheck %s
>
>  class Foo {                         // CHECK: class Bar {
>  //    ^ offset must be here
> @@ -22,5 +20,5 @@ int main() {
>    return 0;
>  }
>
> -// Use grep -FUbo 'Foo' <file> to get the correct offset of Cla when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/Variable.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/Variable.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/Variable.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/Variable.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=148 -new-name=Bar %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=87 -new-name=Bar %s -- | FileCheck %s
>
>  namespace A {
>  int Foo;                // CHECK: int Bar;
> @@ -23,5 +21,5 @@ void fun() {
>    Foo = b.Foo;          // Foo = b.Foo;
>  }
>
> -// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'Foo' <file> to get the correct offset of Foo when
> changing
>  // this file.
>
> Modified: clang-tools-extra/trunk/test/clang-rename/VariableMacro.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-rename/VariableMacro.cpp?rev=276836&r1=276835&r2=276836&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/test/clang-rename/VariableMacro.cpp (original)
> +++ clang-tools-extra/trunk/test/clang-rename/VariableMacro.cpp Tue Jul 26
> 23:43:15 2016
> @@ -1,6 +1,4 @@
> -// RUN: cat %s > %t.cpp
> -// RUN: clang-rename -offset=208 -new-name=Z %t.cpp -i --
> -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
> +// RUN: clang-rename -offset=147 -new-name=Z %s -- | FileCheck %s
>
>  #define Y X // CHECK: #define Y Z
>
> @@ -14,5 +12,5 @@ void macro() {
>    foo(Y);
>  }
>
> -// Use grep -FUbo 'foo;' <file> to get the correct offset of foo when
> changing
> +// Use grep -FUbo 'X' <file> to get the correct offset of X when changing
>  // this file.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160801/a83f3db8/attachment-0001.html>


More information about the cfe-commits mailing list