-// 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 {};
-// 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 {};
-// 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
};
-// 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:
-// 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
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.
-// 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;
-// 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:
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.
-// 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 {};
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.
-// 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:
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.
-// 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:
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.
-// 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 {};
-// 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:
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.
-// 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:
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.
-// 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:
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.
-// 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;
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.
-// 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;
-// 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
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.
-// 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:
-// 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;
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.
-// 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 {
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.
-// 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 {
};
-// 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) {
-// 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) {
-// 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.
-// 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
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.
-// 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;
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.
-// 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
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.