2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -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) {
|
2009-10-13 04:06:34 +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();
|
|
|
|
}
|
|
|
|
}
|