1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck %s 2 3 #pragma GCC diagnostic ignored "-Wincompatible-ms-struct" 4 #define ATTR __attribute__((__ms_struct__)) 5 6 struct ATTR VBase { 7 virtual void foo() = 0; 8 }; 9 10 struct ATTR Base : virtual VBase { 11 virtual void bar() = 0; 12 }; 13 14 struct ATTR Derived : Base { 15 Derived(); 16 void foo(); 17 void bar(); 18 int value; 19 }; 20 21 // CHECK: [[DERIVED:%.*]] = type <{ [[BASE:%.*]], i32, [4 x i8] }> 22 // CHECK: [[BASE]] = type { [[VBASE:%.*]] } 23 // CHECK: [[VBASE]] = type { ptr } 24 25 // CHECK: define{{.*}} void @_ZN7DerivedC2Ev 26 // CHECK: [[SELF:%.*]] = load ptr 27 // CHECK: call void @_ZN4BaseC2Ev(ptr {{[^,]*}} [[SELF]], ptr 28 // CHECK: [[T0:%.*]] = getelementptr inbounds {{.*}} [[SELF]], i32 0, i32 1 29 // CHECK: store i32 20, ptr [[T0]], Derived()30Derived::Derived() : value(20) {} 31