[clang-rename] remove obsolete tests and apply fixes to existing
Few tests introduced by previous patch had obsolete counterparts. Applied fixes to {Dynamic|Static}CastExpr.cpp llvm-svn: 275681
This commit is contained in:
parent
cda19c230c
commit
1114048ac8
|
@ -1,15 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=138 -new-name=Hector %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class Cla // CHECK: class Hector
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Cla *Pointer = 0; // CHECK: Hector *Pointer = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use grep -FUbo 'Cla' <file> to get the correct offset of Cla when changing
|
|
||||||
// this file.
|
|
|
@ -1,10 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -old-name=Cla -new-name=Hector %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class Cla { // CHECK: class Hector
|
|
||||||
};
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
Cla *Pointer = 0; // CHECK: Hector *Pointer = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
// RUN: rm -rf %t
|
|
||||||
// RUN: mkdir -p %t/fixes
|
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=256 -new-name=Hector -export-fixes=%t/fixes/clang-rename.yaml %t.cpp --
|
|
||||||
// RUN: clang-apply-replacements %t
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class Cla // CHECK: class Hector
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// Use grep -FUbo 'Cla' <file> to get the correct offset of Cla when changing
|
|
||||||
// this file.
|
|
|
@ -1,15 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=133 -new-name=D %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class C
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
C();
|
|
||||||
};
|
|
||||||
|
|
||||||
C::C() // CHECK: D::D()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use grep -FUbo 'C' <file> to get the correct offset of foo when changing
|
|
||||||
// this file.
|
|
|
@ -1,20 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=162 -new-name=hector %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class A
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
class Cla
|
|
||||||
{
|
|
||||||
A foo; // CHECK: hector;
|
|
||||||
public:
|
|
||||||
Cla();
|
|
||||||
};
|
|
||||||
|
|
||||||
Cla::Cla() // CHECK: Cla::Cla()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use grep -FUbo 'foo' <file> to get the correct offset of foo when changing
|
|
||||||
// this file.
|
|
|
@ -1,17 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=135 -new-name=Bar %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class Foo {
|
|
||||||
public:
|
|
||||||
Foo();
|
|
||||||
~Foo(); // CHECK: ~Bar();
|
|
||||||
};
|
|
||||||
|
|
||||||
Foo::Foo() {
|
|
||||||
}
|
|
||||||
|
|
||||||
Foo::~Foo() { // CHECK: Bar::~Bar()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use grep -FUbo 'Foo' <file> to get the correct offset of foo when changing
|
|
||||||
// this file.
|
|
|
@ -1,11 +1,12 @@
|
||||||
// RUN: cat %s > %t.cpp
|
// RUN: cat %s > %t.cpp
|
||||||
// RUN: clang-rename -offset=193 -new-name=X %t.cpp -i -- -frtti
|
// RUN: clang-rename -offset=195 -new-name=Bar %t.cpp -i -- -frtti
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
||||||
class Base {
|
|
||||||
|
class Baz {
|
||||||
virtual int getValue() const = 0;
|
virtual int getValue() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Derived : public Base {
|
class Foo : public Baz { // CHECK: class Bar : public Baz {
|
||||||
public:
|
public:
|
||||||
int getValue() const {
|
int getValue() const {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -13,13 +14,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
Derived D;
|
Foo foo; // FIXME: Bar foo; <- this one fails
|
||||||
const Base &Reference = D;
|
const Baz &Reference = foo;
|
||||||
const Base *Pointer = &D;
|
const Baz *Pointer = &foo;
|
||||||
|
|
||||||
dynamic_cast<const Derived &>(Reference).getValue(); // CHECK: dynamic_cast<const X &>
|
dynamic_cast<const Foo &>(Reference).getValue(); // CHECK: dynamic_cast<const Bar &>(Reference).getValue();
|
||||||
dynamic_cast<const Derived *>(Pointer)->getValue(); // CHECK: dynamic_cast<const X *>
|
dynamic_cast<const Foo *>(Pointer)->getValue(); // CHECK: dynamic_cast<const Bar *>(Pointer)->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use grep -FUbo 'Derived' <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.
|
// this file.
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=150 -new-name=hector %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
class Cla
|
|
||||||
{
|
|
||||||
int foo; // CHECK: hector;
|
|
||||||
public:
|
|
||||||
Cla();
|
|
||||||
};
|
|
||||||
|
|
||||||
Cla::Cla()
|
|
||||||
: foo(0) // CHECK: hector(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use grep -FUbo 'foo' <file> to get the correct offset of foo when changing
|
|
||||||
// this file.
|
|
|
@ -1,10 +1,11 @@
|
||||||
// RUN: cat %s > %t.cpp
|
// RUN: cat %s > %t.cpp
|
||||||
// RUN: clang-rename -offset=150 -new-name=X %t.cpp -i --
|
// RUN: clang-rename -offset=152 -new-name=Bar %t.cpp -i --
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
||||||
class Base {
|
|
||||||
|
class Baz {
|
||||||
};
|
};
|
||||||
|
|
||||||
class Derived : public Base {
|
class Foo : public Baz { // CHECK: class Bar : public Baz {
|
||||||
public:
|
public:
|
||||||
int getValue() const {
|
int getValue() const {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -12,13 +13,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
Derived D;
|
Foo foo; // FIXME: Bar foo;
|
||||||
const Base &Reference = D;
|
const Baz &Reference = foo;
|
||||||
const Base *Pointer = &D;
|
const Baz *Pointer = &foo;
|
||||||
|
|
||||||
static_cast<const Derived &>(Reference).getValue(); // CHECK: static_cast<const X &>
|
static_cast<const Foo &>(Reference).getValue(); // CHECK: static_cast<const Bar &>(Reference).getValue();
|
||||||
static_cast<const Derived *>(Pointer)->getValue(); // CHECK: static_cast<const X *>
|
static_cast<const Foo *>(Pointer)->getValue(); // CHECK: static_cast<const Bar *>(Pointer)->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use grep -FUbo 'Derived' <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.
|
// this file.
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
// RUN: cat %s > %t.cpp
|
|
||||||
// RUN: clang-rename -offset=150 -new-name=hector %t.cpp -i --
|
|
||||||
// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
|
|
||||||
namespace A { int foo; // CHECK: int hector;
|
|
||||||
}
|
|
||||||
int foo; // CHECK: int foo;
|
|
||||||
int bar = foo; // CHECK: bar = foo;
|
|
||||||
int baz = A::foo; // CHECK: baz = A::hector;
|
|
||||||
void fun1() {
|
|
||||||
struct {
|
|
||||||
int foo; // CHECK: int foo;
|
|
||||||
} b = { 100 };
|
|
||||||
int foo = 100; // CHECK: int foo
|
|
||||||
baz = foo; // CHECK: baz = foo;
|
|
||||||
{
|
|
||||||
extern int foo; // CHECK: int foo;
|
|
||||||
baz = foo; // CHECK: baz = foo;
|
|
||||||
foo = A::foo + baz; // CHECK: foo = A::hector + baz;
|
|
||||||
A::foo = b.foo; // CHECK: A::hector = b.foo;
|
|
||||||
}
|
|
||||||
foo = b.foo; // CHECK: foo = b.foo;
|
|
||||||
}
|
|
||||||
// Use grep -FUbo 'foo;' <file> to get the correct offset of foo when changing
|
|
||||||
// this file.
|
|
Loading…
Reference in New Issue