blob: 5ce6bf32edf3890271a4fd6ffe70660c2bb7bc7b [file] [log] [blame]
Kostya Serebryany8cb4a072012-03-26 17:03:51 +00001// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s
2// Check that we generate TBAA for vtable pointer loads and stores.
3struct A {
4 virtual int foo() const ;
5 virtual ~A();
6};
7
8void CreateA() {
9 new A;
10}
11
12void CallFoo(A *a) {
13 a->foo();
14}
15
Daniel Dunbar5432ff22012-03-26 20:18:16 +000016// CHECK: %{{.*}} = load {{.*}} !tbaa !0
Kostya Serebryany8cb4a072012-03-26 17:03:51 +000017// CHECK: store {{.*}} !tbaa !0
18// CHECK: !0 = metadata !{metadata !"vtable pointer", metadata !1}
Duncan Sands2d7cb062012-04-15 18:04:54 +000019// CHECK: !1 = metadata !{metadata !"Simple C/C++ TBAA"}