opnsense-src/test/CodeGenCXX/virtual-function-calls.cpp

39 lines
413 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2009-10-14 14:03:49 -04:00
// PR5021
2010-02-16 04:31:36 -05:00
namespace PR5021 {
2009-10-14 14:03:49 -04:00
struct A {
virtual void f(char);
};
void f(A *a) {
// CHECK: call void %
a->f('c');
}
2010-01-01 05:34:51 -05:00
struct B : virtual A {
virtual void f();
};
void f(B * b) {
b->f();
2010-02-16 04:31:36 -05:00
}
}
namespace Test1 {
struct A {
virtual ~A();
};
struct B : A {
virtual ~B();
virtual void f();
};
void f(B *b) {
b->f();
}
}