class-layout.test
2.3 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
; REQUIRES: diasdk
; RUN: llvm-pdbutil pretty -all -class-recurse-depth=1 \
; RUN: %p/Inputs/ClassLayoutTest.pdb > %t
; RUN: FileCheck -input-file=%t %s -check-prefix=GLOBALS_TEST
; RUN: FileCheck -input-file=%t %s -check-prefix=MEMBERS_TEST
; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_A
; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_B
; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_C
; RUN: FileCheck -input-file=%t %s -check-prefix=BASE_CLASS_D
; RUN: FileCheck -input-file=%t %s -check-prefix=UDT_KIND_TEST
; RUN: FileCheck -input-file=%t %s -check-prefix=BITFIELD_TEST
; GLOBALS_TEST: ---GLOBALS---
; GLOBALS_TEST-DAG: int GlobalsTest::IntVar
; GLOBALS_TEST-DAG: double GlobalsTest::DoubleVar
; GLOBALS_TEST-DAG: GlobalsTest::Enum GlobalsTest::EnumVar
; MEMBERS_TEST: ---TYPES---
; MEMBERS_TEST: class MembersTest::A [sizeof = 16] {
; MEMBERS_TEST-DAG: typedef int NestedTypedef
; MEMBERS_TEST-DAG: enum NestedEnum
; MEMBERS_TEST: void {{(MembersTest::A::)?}}MemberFunc()
; MEMBERS_TEST-DAG: data +0x00 [sizeof=4] int IntMemberVar
; MEMBERS_TEST-NEXT: <padding> (4 bytes)
; MEMBERS_TEST-NEXT: data +0x08 [sizeof=8] double DoubleMemberVar
; MEMBERS_TEST: }
; BASE_CLASS_A: ---TYPES---
; BASE_CLASS_A: class BaseClassTest::A [sizeof = 1] {}
; BASE_CLASS_B: ---TYPES---
; BASE_CLASS_B: class BaseClassTest::B [sizeof = 4]
; BASE_CLASS_B-NEXT: : public virtual BaseClassTest::A {
; BASE_CLASS_C: ---TYPES---
; BASE_CLASS_C: class BaseClassTest::C [sizeof = 4]
; BASE_CLASS_C-NEXT: : public virtual BaseClassTest::A {
; BASE_CLASS_D: ---TYPES---
; BASE_CLASS_D: class BaseClassTest::D [sizeof = 8]
; BASE_CLASS_D-NEXT: protected BaseClassTest::B
; BASE_CLASS_D-NEXT: private BaseClassTest::C
; UDT_KIND_TEST: ---TYPES---
; UDT_KIND_TEST-DAG: union UdtKindTest::C [sizeof = 1] {}
; UDT_KIND_TEST-DAG: class UdtKindTest::B [sizeof = 1] {}
; UDT_KIND_TEST-DAG: struct UdtKindTest::A [sizeof = 1] {}
; BITFIELD_TEST: ---TYPES---
; BITFIELD_TEST: struct BitFieldTest::A [sizeof = 8] {
; BITFIELD_TEST-NEXT: +0x00 [sizeof=4] int Bits1 : 1
; BITFIELD_TEST-NEXT: +0x00 [sizeof=4] int Bits2 : 2
; BITFIELD_TEST-NEXT: +0x00 [sizeof=4] int Bits3 : 3
; BITFIELD_TEST-NEXT: +0x00 [sizeof=4] int Bits4 : 4
; BITFIELD_TEST-NEXT: +0x00 [sizeof=4] int Bits22 : 22
; BITFIELD_TEST-NEXT: +0x04 [sizeof=4] int Offset0x04