2014-01-15 03:35:09 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - | FileCheck %s
|
2009-10-07 01:54:23 +08:00
|
|
|
|
|
|
|
// PR5021
|
2010-02-13 02:14:46 +08:00
|
|
|
namespace PR5021 {
|
|
|
|
|
2009-10-07 01:54:23 +08:00
|
|
|
struct A {
|
|
|
|
virtual void f(char);
|
|
|
|
};
|
|
|
|
|
|
|
|
void f(A *a) {
|
2013-12-13 00:07:11 +08:00
|
|
|
// CHECK: call {{.*}}void %
|
2009-10-07 01:54:23 +08:00
|
|
|
a->f('c');
|
|
|
|
}
|
2009-12-19 10:13:41 +08:00
|
|
|
|
|
|
|
struct B : virtual A {
|
|
|
|
virtual void f();
|
|
|
|
};
|
|
|
|
|
|
|
|
void f(B * b) {
|
|
|
|
b->f();
|
2010-02-13 02:14:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Test1 {
|
|
|
|
struct A {
|
|
|
|
virtual ~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct B : A {
|
|
|
|
virtual ~B();
|
|
|
|
virtual void f();
|
|
|
|
};
|
|
|
|
|
|
|
|
void f(B *b) {
|
|
|
|
b->f();
|
|
|
|
}
|
|
|
|
}
|
2013-03-05 16:30:04 +08:00
|
|
|
|
|
|
|
namespace VirtualNoreturn {
|
|
|
|
struct A {
|
|
|
|
[[noreturn]] virtual void f();
|
|
|
|
};
|
|
|
|
|
2015-10-01 20:58:41 +08:00
|
|
|
// CHECK: @_ZN15VirtualNoreturn1f
|
2013-03-05 16:30:04 +08:00
|
|
|
void f(A *p) {
|
|
|
|
p->f();
|
2013-12-13 00:07:11 +08:00
|
|
|
// CHECK: call {{.*}}void %{{[^#]*$}}
|
2013-03-05 16:30:04 +08:00
|
|
|
// CHECK-NOT: unreachable
|
|
|
|
}
|
|
|
|
}
|