llvm-project/llvm/test/tools/llvm-pdbdump/class-layout.test

56 lines
2.3 KiB
Plaintext

; 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 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