2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
2009-10-13 03:41:04 +08:00
|
|
|
|
|
|
|
struct A {
|
|
|
|
virtual void f();
|
2009-10-13 03:51:33 +08:00
|
|
|
|
|
|
|
A h();
|
2009-10-13 03:41:04 +08:00
|
|
|
};
|
|
|
|
|
2009-10-13 03:51:33 +08:00
|
|
|
A g();
|
|
|
|
|
2009-10-13 03:41:04 +08:00
|
|
|
void f(A a, A *ap, A& ar) {
|
|
|
|
// This should not be a virtual function call.
|
|
|
|
|
|
|
|
// CHECK: call void @_ZN1A1fEv(%struct.A* %a)
|
|
|
|
a.f();
|
|
|
|
|
|
|
|
// CHECK: call void %
|
|
|
|
ap->f();
|
|
|
|
|
|
|
|
// CHECK: call void %
|
|
|
|
ar.f();
|
2009-10-13 03:45:47 +08:00
|
|
|
|
|
|
|
// CHECK: call void @_ZN1A1fEv
|
|
|
|
A().f();
|
2009-10-13 03:51:33 +08:00
|
|
|
|
|
|
|
// CHECK: call void @_ZN1A1fEv
|
|
|
|
g().f();
|
|
|
|
|
|
|
|
// CHECK: call void @_ZN1A1fEv
|
|
|
|
a.h().f();
|
2009-10-13 03:41:04 +08:00
|
|
|
}
|
2009-10-13 03:59:15 +08:00
|
|
|
|
|
|
|
struct B {
|
|
|
|
virtual void f();
|
|
|
|
~B();
|
|
|
|
|
|
|
|
B h();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
// CHECK: call void @_ZN1B1fEv
|
|
|
|
B().f();
|
|
|
|
|
|
|
|
// CHECK: call void @_ZN1B1fEv
|
|
|
|
B().h().f();
|
|
|
|
}
|