2012-03-27 01:03:51 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s
|
|
|
|
// Check that we generate TBAA for vtable pointer loads and stores.
|
|
|
|
struct A {
|
|
|
|
virtual int foo() const ;
|
|
|
|
virtual ~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
void CreateA() {
|
|
|
|
new A;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CallFoo(A *a) {
|
|
|
|
a->foo();
|
|
|
|
}
|
|
|
|
|
2012-03-27 04:18:16 +08:00
|
|
|
// CHECK: %{{.*}} = load {{.*}} !tbaa !0
|
2012-03-27 01:03:51 +08:00
|
|
|
// CHECK: store {{.*}} !tbaa !0
|
|
|
|
// CHECK: !0 = metadata !{metadata !"vtable pointer", metadata !1}
|
2012-04-16 02:04:54 +08:00
|
|
|
// CHECK: !1 = metadata !{metadata !"Simple C/C++ TBAA"}
|