pdb-native-pointers.test 12.2 KB
; Test that the native PDB reader can enumerate pointer types.  The output
; being checked against is golden output generated by llvm-pdbutil without
; the -native flag.  Then we check that we generate the same output.

; RUN: llvm-pdbutil pretty -native -pointers \
; RUN:     %p/../Inputs/every-pointer.pdb | FileCheck %s --check-prefix=PRETTY
; RUN: llvm-pdbutil diadump -no-ids -native -pointers \
; RUN:     %p/../Inputs/every-pointer.pdb | FileCheck %s

; PRETTY:      Pointers: (29 items)
; PRETTY-NEXT: char**
; PRETTY-NEXT: struct Foo*
; PRETTY-NEXT: int&
; PRETTY-NEXT: const int*
; PRETTY-NEXT: volatile int*
; PRETTY-NEXT: const volatile int*
; PRETTY-NEXT: int*
; PRETTY-NEXT: int*
; PRETTY-NEXT: struct __vc_attributes::event_sourceAttribute*
; PRETTY-NEXT: struct __vc_attributes::helper_attributes::v1_alttypeAttribute*
; PRETTY-NEXT: struct __vc_attributes::helper_attributes::usageAttribute*
; PRETTY-NEXT: struct __vc_attributes::threadingAttribute*
; PRETTY-NEXT: struct __vc_attributes::aggregatableAttribute*
; PRETTY-NEXT: struct __vc_attributes::event_receiverAttribute*
; PRETTY-NEXT: struct __vc_attributes::moduleAttribute*
; PRETTY-NEXT: const char*
; PRETTY-NEXT: int&&
; PRETTY-NEXT: struct Foo*
; PRETTY-NEXT: void (__cdecl Foo::*)()
; PRETTY-NEXT: int Foo::*
; PRETTY-NEXT: int (__cdecl Foo::*)()
; PRETTY-NEXT: void (__cdecl *)()
; PRETTY-NEXT: unaligned struct Foo*
; PRETTY-NEXT: struct Foo*
; PRETTY-NEXT: const struct Foo*
; PRETTY-NEXT: volatile struct Foo*
; PRETTY-NEXT: const volatile struct Foo*
; PRETTY-NEXT: struct Foo&&
; PRETTY-NEXT: struct Foo

; CHECK:      {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 1
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 1
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 1
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 1
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 1
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   isSingleInheritance: 1
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 4
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 1
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   isSingleInheritance: 1
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 1
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   isSingleInheritance: 1
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 1
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 1
; CHECK-NEXT:   reference: 0
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT:   symTag: PointerType
; CHECK-NEXT:   length: 8
; CHECK-NEXT:   constType: 0
; CHECK-NEXT:   isPointerToDataMember: 0
; CHECK-NEXT:   isPointerToMemberFunction: 0
; CHECK-NEXT:   RValueReference: 0
; CHECK-NEXT:   reference: 1
; CHECK-NEXT:   restrictedType: 0
; CHECK-NEXT:   unalignedType: 0
; CHECK-NEXT:   volatileType: 0
; CHECK-NEXT: }