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