• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
StructB()14 StructB::StructB() {
15   a = 42;
16 // CHECK: store i32 42, i32* {{.*}}, !tbaa [[TAG_A_i32:!.*]]
17 }
18 
19 // CHECK: [[TYPE_INT:!.*]] = !{!"int", [[TYPE_CHAR:!.*]], i64 0}
20 // CHECK: [[TYPE_CHAR]] = !{!"omnipotent char", !
21 // CHECK: [[TAG_A_i32]] = !{[[TYPE_A:!.*]], [[TYPE_INT]], i64 0}
22 // CHECK: [[TYPE_A]] = !{!"?AUStructA@@", [[TYPE_INT]], i64 0}
23