1# To regenerate t1.obj and t2.obj, run the following: 2# $ cat t.cpp 3# #ifdef CONFIG1 4# struct A; 5# struct B { 6# A *a; 7# }; 8# int f(A *a); 9# int g(B *b) { return f(b->a); } 10# #else 11# struct B; 12# struct A { 13# B *b; 14# }; 15# int g(B *b); 16# int f(A *a) { return g(a->b); } 17# #endif 18# $ cl -c -DCONFIG1 -Z7 t.cpp -Fot1.obj && cl -c -Z7 t.cpp -Fot2.obj 19 20RUN: llvm-readobj -codeview %S/Inputs/codeview-merging-1.obj | FileCheck %s --check-prefix=OBJ1 21RUN: llvm-readobj -codeview %S/Inputs/codeview-merging-2.obj | FileCheck %s --check-prefix=OBJ2 22RUN: llvm-readobj -codeview-merged-types %S/Inputs/codeview-merging-1.obj %S/Inputs/codeview-merging-2.obj | FileCheck %s 23 24OBJ1: Procedure ({{.*}}) { 25OBJ1-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008) 26OBJ1-NEXT: ReturnType: int (0x74) 27OBJ1-NEXT: CallingConvention: NearC (0x0) 28OBJ1-NEXT: FunctionOptions [ (0x0) 29OBJ1-NEXT: ] 30OBJ1-NEXT: NumParameters: 1 31OBJ1-NEXT: ArgListType: (A*) (0x1002) 32OBJ1-NEXT: } 33OBJ1: FuncId (0x100D) { 34OBJ1-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 35OBJ1-NEXT: ParentScope: 0x0 36OBJ1-NEXT: FunctionType: int (B*) (0x100C) 37OBJ1-NEXT: Name: g 38OBJ1-NEXT: } 39OBJ1-NEXT: FuncId (0x100E) { 40OBJ1-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 41OBJ1-NEXT: ParentScope: 0x0 42OBJ1-NEXT: FunctionType: int (A*) (0x1003) 43OBJ1-NEXT: Name: f 44OBJ1-NEXT: } 45OBJ1-NOT: FuncId 46 47OBJ2: FuncId (0x100D) { 48OBJ2-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 49OBJ2-NEXT: ParentScope: 0x0 50OBJ2-NEXT: FunctionType: int (A*) (0x100C) 51OBJ2-NEXT: Name: f 52OBJ2-NEXT: } 53 54OBJ2: FuncId (0x1069) { 55OBJ2-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 56OBJ2-NEXT: ParentScope: 0x0 57OBJ2-NEXT: FunctionType: int (B*) (0x1003) 58OBJ2-NEXT: Name: g 59OBJ2-NEXT: } 60OBJ2-NOT: FuncId 61 62CHECK: MergedTypeStream [ 63CHECK: Procedure ({{.*}}) { 64CHECK-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008) 65CHECK-NEXT: ReturnType: int (0x74) 66CHECK-NEXT: CallingConvention: NearC (0x0) 67CHECK-NEXT: FunctionOptions [ (0x0) 68CHECK-NEXT: ] 69CHECK-NEXT: NumParameters: 1 70CHECK-NEXT: ArgListType: (A*) (0x1002) 71CHECK-NEXT: } 72CHECK: Struct (0x1007) { 73CHECK-NEXT: TypeLeafKind: LF_STRUCTURE (0x1505) 74CHECK-NEXT: MemberCount: 1 75CHECK-NEXT: Properties [ (0x200) 76CHECK-NEXT: HasUniqueName (0x200) 77CHECK-NEXT: ] 78CHECK-NEXT: FieldList: <field list> (0x1006) 79CHECK-NEXT: DerivedFrom: 0x0 80CHECK-NEXT: VShape: 0x0 81CHECK-NEXT: SizeOf: 8 82CHECK-NEXT: Name: B 83CHECK-NEXT: LinkageName: .?AUB@@ 84CHECK-NEXT: } 85CHECK: ] 86 87CHECK: MergedIDStream [ 88CHECK-NEXT: StringId (0x1000) { 89CHECK-NEXT: TypeLeafKind: LF_STRING_ID (0x1605) 90CHECK-NEXT: Id: 0x0 91CHECK-NEXT: StringData: d:\src\llvm\build\t.cpp 92CHECK-NEXT: } 93# Test that we contextually dump item ids and type ids from different databases. 94CHECK-NEXT: UdtSourceLine (0x1001) { 95CHECK-NEXT: TypeLeafKind: LF_UDT_SRC_LINE (0x1606) 96CHECK-NEXT: UDT: B (0x1007) 97CHECK-NEXT: SourceFile: d:\src\llvm\build\t.cpp (0x1000) 98CHECK-NEXT: LineNumber: 3 99CHECK-NEXT: } 100CHECK: FuncId (0x1002) { 101CHECK-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 102CHECK-NEXT: ParentScope: 0x0 103CHECK-NEXT: FunctionType: int (B*) 104CHECK-NEXT: Name: g 105CHECK-NEXT: } 106CHECK-NEXT: FuncId (0x1003) { 107CHECK-NEXT: TypeLeafKind: LF_FUNC_ID (0x1601) 108CHECK-NEXT: ParentScope: 0x0 109CHECK-NEXT: FunctionType: int (A*) 110CHECK-NEXT: Name: f 111CHECK-NEXT: } 112CHECK-NOT: FuncId 113CHECK: ] 114