Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -triple i686-pc-win32 -disable-llvm-optzns -emit-llvm -o - -O1 %s | FileCheck %s
      2 //
      3 // Test that TBAA works in the Microsoft C++ ABI.  We used to error out while
      4 // attempting to mangle RTTI.
      5 
      6 struct StructA {
      7   int a;
      8 };
      9 
     10 struct StructB : virtual StructA {
     11   StructB();
     12 };
     13 
     14 StructB::StructB() {
     15   a = 42;
     16 // CHECK: store i32 42, i32* {{.*}}, !tbaa [[TAG_A_i32:!.*]]
     17 }
     18 
     19 // CHECK: [[TYPE_INT:!.*]] = metadata !{metadata !"int", metadata [[TYPE_CHAR:!.*]], i64 0}
     20 // CHECK: [[TYPE_CHAR]] = metadata !{metadata !"omnipotent char", metadata
     21 // CHECK: [[TAG_A_i32]] = metadata !{metadata [[TYPE_A:!.*]], metadata [[TYPE_INT]], i64 0}
     22 // CHECK: [[TYPE_A]] = metadata !{metadata !"?AUStructA@@", metadata [[TYPE_INT]], i64 0}
     23