Home | History | Annotate | Download | only in llvm-pdbdump
      1 ; RUN: llvm-pdbutil pretty -classes -class-definitions=layout \
      2 ; RUN:     -include-types=SimplePad %p/Inputs/SimplePaddingTest.pdb > %t
      3 
      4 ; RUN: FileCheck -input-file=%t %s -check-prefix=NO_PADDING
      5 ; RUN: FileCheck -input-file=%t %s -check-prefix=UNION
      6 ; RUN: FileCheck -input-file=%t %s -check-prefix=NESTED_UNION
      7 ; RUN: FileCheck -input-file=%t %s -check-prefix=PAD_FROM_FIELDS1
      8 ; RUN: FileCheck -input-file=%t %s -check-prefix=PAD_FROM_FIELDS2
      9 ; RUN: FileCheck -input-file=%t %s -check-prefix=NO_PAD_IN_BASE
     10 ; RUN: FileCheck -input-file=%t %s -check-prefix=PAD_IN_DERIVED
     11 ; RUN: FileCheck -input-file=%t %s -check-prefix=EMPTY_BASE
     12 ; RUN: FileCheck -input-file=%t %s -check-prefix=VFPTR
     13 ; RUN: FileCheck -input-file=%t %s -check-prefix=MULTIPLE_INHERIT
     14 ; RUN: FileCheck -input-file=%t %s -check-prefix=MULTIPLE_INHERIT2
     15 ; RUN: FileCheck -input-file=%t %s -check-prefix=DEEP_INHERIT
     16 ; RUN: FileCheck -input-file=%t %s -check-prefix=AGGREGATE
     17 
     18 ; NO_PADDING:      struct SimplePadNoPadding [sizeof = 8] {
     19 ; NO_PADDING-NEXT:   data +0x00 [sizeof=4] int X
     20 ; NO_PADDING-NEXT:   data +0x04 [sizeof=4] int Y
     21 ; NO_PADDING-NEXT: }
     22 
     23 ; UNION:      struct SimplePadUnion [sizeof = 16] {
     24 ; UNION-NEXT:   data +0x00 [sizeof=4] int X
     25 ; UNION-NEXT:   data +0x00 [sizeof=8] __int64 Y
     26 ; UNION-NEXT:   data +0x00 [sizeof=16] SimplePadUnion::
     27 ; UNION-NEXT:     data +0x00 [sizeof=4] int X
     28 ; UNION-NEXT:     <padding> (4 bytes)
     29 ; UNION-NEXT:     data +0x08 [sizeof=8] __int64 Y
     30 ; UNION-NEXT: }
     31 
     32 ; NESTED_UNION:      struct {{SimplePadUnion::.*}} [sizeof = 16] {
     33 ; NESTED_UNION-NEXT:   data +0x00 [sizeof=4] int X
     34 ; NESTED_UNION-NEXT:   <padding> (4 bytes)
     35 ; NESTED_UNION-NEXT:   data +0x08 [sizeof=8] __int64 Y
     36 ; NESTED_UNION-NEXT: }
     37 
     38 ; PAD_FROM_FIELDS1:      struct SimplePadFields1 [sizeof = 4] {
     39 ; PAD_FROM_FIELDS1-NEXT:   data +0x00 [sizeof=1] char A
     40 ; PAD_FROM_FIELDS1-NEXT:   data +0x01 [sizeof=1] char B
     41 ; PAD_FROM_FIELDS1-NEXT:   data +0x02 [sizeof=1] char C
     42 ; PAD_FROM_FIELDS1-NEXT:   <padding> (1 bytes)
     43 ; PAD_FROM_FIELDS1-NEXT: }
     44 
     45 ; PAD_FROM_FIELDS2:      struct SimplePadFields2 [sizeof = 8] {
     46 ; PAD_FROM_FIELDS2-NEXT:   data +0x00 [sizeof=4] int Y
     47 ; PAD_FROM_FIELDS2-NEXT:   data +0x04 [sizeof=1] char X
     48 ; PAD_FROM_FIELDS2-NEXT:   <padding> (3 bytes)
     49 ; PAD_FROM_FIELDS2-NEXT: }
     50 
     51 ; NO_PAD_IN_BASE:      struct SimplePadBase [sizeof = 4] {
     52 ; NO_PAD_IN_BASE-NEXT:   data +0x00 [sizeof=4] int X
     53 ; NO_PAD_IN_BASE-NEXT: }
     54 
     55 ; PAD_IN_DERIVED:      struct SimplePadDerived [sizeof = 16]
     56 ; PAD_IN_DERIVED-NEXT:   : public SimplePadBase {
     57 ; PAD_IN_DERIVED-NEXT:   base +0x00 [sizeof=4] SimplePadBase
     58 ; PAD_IN_DERIVED-NEXT:     data +0x00 [sizeof=4] int X
     59 ; PAD_IN_DERIVED-NEXT:   <padding> (4 bytes)
     60 ; PAD_IN_DERIVED-NEXT:   data +0x08 [sizeof=8] __int64 Y
     61 ; PAD_IN_DERIVED-NEXT: }
     62 
     63 ; EMPTY_BASE:      struct SimplePadEmpty [sizeof = 8]
     64 ; EMPTY_BASE-NEXT:   : public SimplePadEmptyBase1
     65 ; EMPTY_BASE-NEXT:   , public SimplePadEmptyBase2 {
     66 ; EMPTY_BASE-NEXT:   base +0x00 [sizeof=1] SimplePadEmptyBase1
     67 ; EMPTY_BASE-NEXT:   base +0x01 [sizeof=1] SimplePadEmptyBase2
     68 ; EMPTY_BASE-NEXT:   <padding> (2 bytes)
     69 ; EMPTY_BASE-NEXT:   data +0x04 [sizeof=4] int X
     70 ; EMPTY_BASE-NEXT: }
     71 
     72 ; VFPTR:      struct SimplePadVfptr [sizeof = 8] {
     73 ; VFPTR-NEXT:   vfptr +0x00 [sizeof=4]
     74 ; VFPTR-NEXT:   data +0x04 [sizeof=4] int X
     75 ; VFPTR-NEXT: }
     76 
     77 ; MULTIPLE_INHERIT:      struct SimplePadMultiInherit [sizeof = 8]
     78 ; MULTIPLE_INHERIT-NEXT:   : public NonEmptyBase1
     79 ; MULTIPLE_INHERIT-NEXT:   , public NonEmptyBase2 {
     80 ; MULTIPLE_INHERIT-NEXT:   base +0x00 [sizeof=1] NonEmptyBase1
     81 ; MULTIPLE_INHERIT-NEXT:     data +0x00 [sizeof=1] bool X
     82 ; MULTIPLE_INHERIT-NEXT:   base +0x01 [sizeof=1] NonEmptyBase2
     83 ; MULTIPLE_INHERIT-NEXT:     data +0x01 [sizeof=1] bool Y
     84 ; MULTIPLE_INHERIT-NEXT:   <padding> (2 bytes)
     85 ; MULTIPLE_INHERIT-NEXT:   data +0x04 [sizeof=4] int X
     86 ; MULTIPLE_INHERIT-NEXT: }
     87 
     88 ; MULTIPLE_INHERIT2:      SimplePadMultiInherit2 [sizeof = 16]
     89 ; MULTIPLE_INHERIT2-NEXT:   : public SimplePadFields1
     90 ; MULTIPLE_INHERIT2-NEXT:   , public SimplePadFields2 {
     91 ; MULTIPLE_INHERIT2-NEXT:   base +0x00 [sizeof=3] SimplePadFields1
     92 ; MULTIPLE_INHERIT2-NEXT:     data +0x00 [sizeof=1] char A
     93 ; MULTIPLE_INHERIT2-NEXT:     data +0x01 [sizeof=1] char B
     94 ; MULTIPLE_INHERIT2-NEXT:     data +0x02 [sizeof=1] char C
     95 ; MULTIPLE_INHERIT2-NEXT:   <padding> (1 bytes)
     96 ; MULTIPLE_INHERIT2-NEXT:   base +0x04 [sizeof=5] SimplePadFields2
     97 ; MULTIPLE_INHERIT2-NEXT:     data +0x04 [sizeof=4] int Y
     98 ; MULTIPLE_INHERIT2-NEXT:     data +0x08 [sizeof=1] char X
     99 ; MULTIPLE_INHERIT2-NEXT:   <padding> (3 bytes)
    100 ; MULTIPLE_INHERIT2-NEXT:   data +0x0c [sizeof=4] int X
    101 ; MULTIPLE_INHERIT2-NEXT: }
    102 
    103 ; DEEP_INHERIT:      struct SimplePadTwoLevelInherit [sizeof = 16]
    104 ; DEEP_INHERIT-NEXT:   : public OneLevelInherit {
    105 ; DEEP_INHERIT-NEXT:     base +0x00 [sizeof=4] OneLevelInherit
    106 ; DEEP_INHERIT-NEXT:       base +0x00 [sizeof=1] NonEmptyBase1
    107 ; DEEP_INHERIT-NEXT:         data +0x00 [sizeof=1] bool X
    108 ; DEEP_INHERIT-NEXT:       <padding> (1 bytes)
    109 ; DEEP_INHERIT-NEXT:       data +0x02 [sizeof=2] short Y
    110 ; DEEP_INHERIT-NEXT:     <padding> (4 bytes)
    111 ; DEEP_INHERIT-NEXT:     data +0x08 [sizeof=8] __int64 Z
    112 ; DEEP_INHERIT-NEXT: }
    113 
    114 
    115 ; AGGREGATE:      struct SimplePadAggregate [sizeof = 12] {
    116 ; AGGREGATE-NEXT:   data +0x00 [sizeof=1] NonEmptyBase1 X
    117 ; AGGREGATE-NEXT:     data +0x00 [sizeof=1] bool X
    118 ; AGGREGATE-NEXT:   <padding> (3 bytes)
    119 ; AGGREGATE-NEXT:   data +0x04 [sizeof=4] int Y
    120 ; AGGREGATE-NEXT:   data +0x08 [sizeof=4] SimplePadFields1 Fields
    121 ; AGGREGATE-NEXT:     data +0x08 [sizeof=1] char A
    122 ; AGGREGATE-NEXT:     data +0x09 [sizeof=1] char B
    123 ; AGGREGATE-NEXT:     data +0x0a [sizeof=1] char C
    124 ; AGGREGATE-NEXT:     <padding> (1 bytes)
    125 ; AGGREGATE-NEXT: }
    126