2 # This test ensures that under /DEBUG:GHASH, IPI records LF_FUNC_ID/LF_MFUNC_ID
3 # have properly remapped indices to corresponding TPI records.
5 RUN: lld-link %p/Inputs/precomp-ghash-precomp.obj \
6 RUN: %p/Inputs/precomp-ghash-obj1.obj\
7 RUN: %p/Inputs/precomp-ghash-obj2.obj /debug:ghash /out:%t.exe /pdb:%t.pdb /nodefaultlib /force
8 RUN: llvm-pdbutil dump -types -ids %t.pdb | FileCheck %s
10 ; These object files were generated via the following inputs and commands:
11 ; ----------------------------------------------
12 ; // precomp-ghash-obj.h
15 ; explicit Foo(int x) : X(x) {}
19 ; int func(const Foo &f);
21 ; ----------------------------------------------
22 ; // precomp-ghash-obj1.cpp
23 ; #include "precomp-ghash-obj.h"
25 ; int main(int argc, char **argv) {
29 ; ----------------------------------------------
30 ; // precomp-ghash-obj2.cpp
31 ; #include "precomp-ghash-obj.h"
33 ; int NS::func(const Foo &f) {
36 ; ----------------------------------------------
37 ; // precomp-ghash-precomp.cpp
38 ; #include "precomp-ghash-obj.h"
39 ; ----------------------------------------------
40 ; $ cl /c /Z7 /GS- precomp-ghash-precomp.cpp /Ycprecomp-ghash-obj.h
41 ; $ cl /c /Z7 /GS- precomp-ghash-obj1.cpp /Yuprecomp-ghash-obj.h
42 ; $ cl /c /Z7 /GS- precomp-ghash-obj2.cpp /Yuprecomp-ghash-obj.h
44 CHECK: Types (TPI Stream)
45 CHECK-NEXT: ============================================================
46 CHECK: 0x1003 | LF_MFUNCTION
47 CHECK: 0x1377 | LF_PROCEDURE
48 CHECK: Types (IPI Stream)
49 CHECK-NEXT: ============================================================
50 CHECK: 0x10A5 | LF_FUNC_ID [size = 20]
51 CHECK-NEXT: name = main, type = 0x1377, parent scope = <no type>
52 CHECK-NEXT: 0x10A6 | LF_MFUNC_ID [size = 20]
53 CHECK-NEXT: name = {ctor}, type = 0x1003, class type = 0x1000