1 Check that the linker behaves when you have multiple
2 PDB files with the same Guid. This was first a problem
3 with Visual Studio 2022 that shipped PDB's with Guid's
4 that was set to FFFFFF...
6 RUN: rm -rf %t && mkdir -p %t && cd %t
7 RUN: yaml2obj %p/Inputs/pdb-type-server-guid-collision-a.yaml -o a.obj
8 RUN: yaml2obj %p/Inputs/pdb-type-server-guid-collision-b.yaml -o b.obj
9 RUN: sed s/b.pdb/c.pdb/ %S/Inputs/pdb-type-server-guid-collision-b.yaml | sed s/b.obj/c.obj/ | sed s/bar_gv/rab_gv/ | sed s/Bar/Rab/ | yaml2obj > c.obj
10 RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-guid-collision-a-pdb.yaml -pdb a.pdb
11 RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-guid-collision-b-pdb.yaml -pdb b.pdb
12 RUN: sed s/b.pdb/c.pdb/ %S/Inputs/pdb-type-server-guid-collision-b-pdb.yaml | sed s/bar_gv/rab_gv/ | sed s/Bar/Rab/ | llvm-pdbutil yaml2pdb - -pdb c.pdb
13 RUN: lld-link b.obj a.obj c.obj -out:collision.dll /debug:ghash -pdb:collision.pdb -nodefaultlib /noentry /dll
14 RUN: lld-link a.obj b.obj c.obj -out:collision.dll /debug:noghash -pdb:collision_noghash.pdb -nodefaultlib /noentry /dll
15 RUN: llvm-pdbutil dump -globals collision.pdb | FileCheck %s
16 RUN: llvm-pdbutil dump -globals collision_noghash.pdb | FileCheck %s
18 CHECK-LABEL: Global Symbols
19 CHECK: ============================================================
21 CHECK-DAG: {{[0-9]+}} | S_GDATA32 [size = 24] `rab_gv`
22 CHECK-NEXT: type = {{[^\s]+}} (Rab), addr = 0002:{{[0-9]+}}
23 CHECK-DAG: {{[0-9]+}} | S_GDATA32 [size = 24] `bar_gv`
24 CHECK-NEXT: type = {{[^\s]+}} (Bar), addr = 0002:{{[0-9]+}}
25 CHECK-DAG: {{[0-9]+}} | S_GDATA32 [size = 24] `foo_gv`
26 CHECK-NEXT: type = {{[^\s]+}} (Foo), addr = 0002:{{[0-9]+}}