test: simplify commands, NFC
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 27 Jul 2016 04:43:15 +0000 (04:43 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 27 Jul 2016 04:43:15 +0000 (04:43 +0000)
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.

llvm-svn: 276836

27 files changed:
clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByClass.cpp
clang-tools-extra/test/clang-rename/ClassAsTemplateArgumentFindByTemplateArgument.cpp
clang-tools-extra/test/clang-rename/ClassFindByName.cpp
clang-tools-extra/test/clang-rename/ClassNameInFunctionDefenition.cpp
clang-tools-extra/test/clang-rename/ClassSimpleRenaming.cpp
clang-tools-extra/test/clang-rename/ComplicatedClassType.cpp
clang-tools-extra/test/clang-rename/ConstCastExpr.cpp
clang-tools-extra/test/clang-rename/ConstructExpr.cpp
clang-tools-extra/test/clang-rename/CtorFindByDeclaration.cpp
clang-tools-extra/test/clang-rename/CtorFindByDefinition.cpp
clang-tools-extra/test/clang-rename/CtorInitializer.cpp
clang-tools-extra/test/clang-rename/DeclRefExpr.cpp
clang-tools-extra/test/clang-rename/DtorDeclaration.cpp
clang-tools-extra/test/clang-rename/DtorDefinition.cpp
clang-tools-extra/test/clang-rename/DynamicCastExpr.cpp
clang-tools-extra/test/clang-rename/Field.cpp
clang-tools-extra/test/clang-rename/FunctionMacro.cpp
clang-tools-extra/test/clang-rename/MemberExprMacro.cpp
clang-tools-extra/test/clang-rename/Namespace.cpp
clang-tools-extra/test/clang-rename/ReinterpretCastExpr.cpp
clang-tools-extra/test/clang-rename/StaticCastExpr.cpp
clang-tools-extra/test/clang-rename/TemplateFunctionFindByDeclaration.cpp
clang-tools-extra/test/clang-rename/TemplateFunctionFindByUse.cpp
clang-tools-extra/test/clang-rename/TemplateTypenameFindByTypeInside.cpp
clang-tools-extra/test/clang-rename/UserDefinedConversionFindByTypeDeclaration.cpp
clang-tools-extra/test/clang-rename/Variable.cpp
clang-tools-extra/test/clang-rename/VariableMacro.cpp

index 19015a2..a75d13c 100644 (file)
@@ -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 {};
 
index 7fdf911..b95f6fc 100644 (file)
@@ -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 {};
 
index 4cd090c..5ec4dea 100644 (file)
@@ -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
 };
index 1b2d59e..91636fa 100644 (file)
@@ -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:
index 72710d0..94c5243 100644 (file)
@@ -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.
index 6e888bd..429c60a 100644 (file)
@@ -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;
index 6d6914f..7336a16 100644 (file)
@@ -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.
index d7f104c..4c795e2 100644 (file)
@@ -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.
index 3fb25ae..d615ba5 100644 (file)
@@ -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.
index 2f7e65c..646d698 100644 (file)
@@ -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.
index 1fa1665..087cb81 100644 (file)
@@ -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 {};
 
index 2059ff0..0706e07 100644 (file)
@@ -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.
index 239ae57..3a10db0 100644 (file)
@@ -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.
index d817397..d3b9402 100644 (file)
@@ -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.
index b940dd7..cd3600d 100644 (file)
@@ -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.
index 2179558..d7c7e7b 100644 (file)
@@ -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;
index 1cdac27..78b93e5 100644 (file)
@@ -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.
index 24ba05f..96900d5 100644 (file)
@@ -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:
index 5eea4a6..7933bf5 100644 (file)
@@ -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.
index 2d5ecd2..277e465 100644 (file)
@@ -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.
index b75102a..c0f4325 100644 (file)
@@ -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 {
 };
index f652902..24343f0 100644 (file)
@@ -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) {
index a3d1717..7c57062 100644 (file)
@@ -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) {
index a7d822b..056bb2a 100644 (file)
@@ -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.
index 271a566..2c020e8 100644 (file)
@@ -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.
index 02935bd..5d356ff 100644 (file)
@@ -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.
index 2a0cd87..1b6c7ce 100644 (file)
@@ -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.