binutils/tests/Sanity/dts-probe-binaries/virtual2.C
Václav Kadlčík 22348da57d Import RHEL's test Sanity/dts-probe-binaries
Unchanged yet, failing on Fedora Rawhide. I'll fix it in the
upcoming commit.
2021-05-12 05:39:34 +02:00

32 lines
346 B
C

// PR c++/52746
// { dg-do run }
extern "C" int printf(const char*,...);
extern "C" void abort();
bool db;
struct A
{
virtual ~A() {}
};
struct B : public A
{
virtual ~B() { db = true; }
};
template<int> void test()
{
B * b = new B;
A * a = b;
a->~A();
::operator delete(b);
}
int main()
{
test<0>();
if (!db)
abort();
}