1 // RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fms-extensions -fsyntax-only %s 2>&1 | FileCheck %s
2 
3 struct __single_inheritance S;
4 struct __multiple_inheritance M;
5 struct __virtual_inheritance V;
6 struct U;
7 
8 struct SD { char a; int S::*mp; };
9 struct MD { char a; int M::*mp; };
10 struct VD { char a; int V::*mp; };
11 struct UD { char a; int U::*mp; };
12 struct SF { char a; int (S::*mp)(); };
13 struct MF { char a; int (M::*mp)(); };
14 struct VF { char a; int (V::*mp)(); };
15 struct UF { char a; int (U::*mp)(); };
16 
17 // CHECK: *** Dumping AST Record Layout
18 // CHECK-NEXT:    0 | struct SD
19 // CHECK-NEXT:    0 |   char a
20 // CHECK-NEXT:    4 |   int struct S::* mp
21 // CHECK-NEXT:      | [sizeof=8, align=4
22 // CHECK-NEXT:      |  nvsize=8, nvalign=4]
23 
24 // CHECK: *** Dumping AST Record Layout
25 // CHECK-NEXT:    0 | struct MD
26 // CHECK-NEXT:    0 |   char a
27 // CHECK-NEXT:    4 |   int struct M::* mp
28 // CHECK-NEXT:      | [sizeof=8, align=4
29 // CHECK-NEXT:      |  nvsize=8, nvalign=4]
30 
31 // CHECK: *** Dumping AST Record Layout
32 // CHECK-NEXT:    0 | struct VD
33 // CHECK-NEXT:    0 |   char a
34 // CHECK-NEXT:    8 |   int struct V::* mp
35 // CHECK-NEXT:      | [sizeof=16, align=8
36 // CHECK-NEXT:      |  nvsize=16, nvalign=8]
37 
38 // CHECK: *** Dumping AST Record Layout
39 // CHECK-NEXT:    0 | struct UD
40 // CHECK-NEXT:    0 |   char a
41 // CHECK-NEXT:    8 |   int struct U::* mp
42 // CHECK-NEXT:      | [sizeof=24, align=8
43 // CHECK-NEXT:      |  nvsize=24, nvalign=8]
44 
45 // CHECK: *** Dumping AST Record Layout
46 // CHECK-NEXT:    0 | struct SF
47 // CHECK-NEXT:    0 |   char a
48 // CHECK-NEXT:    4 |   int (struct S::*)(void) __attribute__((thiscall)) mp
49 // CHECK-NEXT:      | [sizeof=8, align=4
50 // CHECK-NEXT:      |  nvsize=8, nvalign=4]
51 
52 // CHECK: *** Dumping AST Record Layout
53 // CHECK-NEXT:    0 | struct MF
54 // CHECK-NEXT:    0 |   char a
55 // CHECK-NEXT:    8 |   int (struct M::*)(void) __attribute__((thiscall)) mp
56 // CHECK-NEXT:      | [sizeof=16, align=8
57 // CHECK-NEXT:      |  nvsize=16, nvalign=8]
58 
59 // CHECK: *** Dumping AST Record Layout
60 // CHECK-NEXT:    0 | struct VF
61 // CHECK-NEXT:    0 |   char a
62 // CHECK-NEXT:    8 |   int (struct V::*)(void) __attribute__((thiscall)) mp
63 // CHECK-NEXT:      | [sizeof=24, align=8
64 // CHECK-NEXT:      |  nvsize=24, nvalign=8]
65 
66 // CHECK: *** Dumping AST Record Layout
67 // CHECK-NEXT:    0 | struct UF
68 // CHECK-NEXT:    0 |   char a
69 // CHECK-NEXT:    8 |   int (struct U::*)(void) __attribute__((thiscall)) mp
70 // CHECK-NEXT:      | [sizeof=24, align=8
71 // CHECK-NEXT:      |  nvsize=24, nvalign=8]
72 
73 char a[sizeof(SD) +
74        sizeof(MD) +
75        sizeof(VD) +
76        sizeof(UD) +
77        sizeof(SF) +
78        sizeof(MF) +
79        sizeof(VF) +
80        sizeof(UF)];
81