1RUN: yaml2obj %S/Inputs/pdb-globals.yaml -o %t.obj 2RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj 3RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s 4 5RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj /threads:1 6RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s 7RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj /threads:2 8RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s 9 10# Test that we correctly distribute symbols between the globals and module 11# symbol streams. Specifically: 12# * S_UDT, S_GDATA32, and S_CONSTANT end up in the globals stream, and are 13# omitted from the module stream. 14# * S_GPROC32 and S_LPROC32 end up in the symbols stream, but S_PROCREF and 15# S_LPROCREF are added to the globals stream that refer to the module 16# stream. 17# * S_LDATA32 is copied byte for byte into both streams. 18 19 20CHECK-LABEL: Global Symbols 21CHECK-NEXT: ============================================================ 22CHECK-NEXT: Records 23CHECK-NEXT: 444 | S_UDT [size = 20] `HelloPoint` 24CHECK-NEXT: original type = 0x1007 25CHECK-NEXT: 240 | S_LPROCREF [size = 24] `LocalFunc` 26CHECK-NEXT: module = 1, sum name = 0, offset = 424 27CHECK-NEXT: 192 | S_PROCREF [size = 28] `GlobalFunc` 28CHECK-NEXT: module = 1, sum name = 0, offset = 136 29CHECK-NEXT: 220 | S_PROCREF [size = 20] `main` 30CHECK-NEXT: module = 1, sum name = 0, offset = 224 31CHECK-NEXT: 340 | S_CONSTANT [size = 24] `ConstexprVar` 32CHECK-NEXT: type = 0x100B (const int), value = 18 33CHECK-NEXT: 264 | S_GDATA32 [size = 28] `__purecall` 34CHECK-NEXT: type = 0x0403 (void*), addr = 0003:0004 35CHECK-NEXT: 292 | S_GDATA32 [size = 24] `GlobalVar` 36CHECK-NEXT: type = 0x100C (const int*), addr = 0003:0000 37CHECK-NEXT: 316 | S_GTHREAD32 [size = 24] `GlobalTLS` 38CHECK-NEXT: type = 0x0074 (int), addr = 0004:0000 39CHECK-NEXT: 392 | S_LTHREAD32 [size = 24] `StaticTLS` 40CHECK-NEXT: type = 0x0074 (int), addr = 0004:0004 41CHECK-NEXT: 416 | S_UDT [size = 28] `HelloPointTypedef` 42CHECK-NEXT: original type = 0x1007 43CHECK-NEXT: 364 | S_LDATA32 [size = 28] `ConstantVar` 44CHECK-NEXT: type = 0x100B (const int), addr = 0002:0000 45CHECK-NEXT: 464 | S_PROCREF [size = 40] `HelloPoint::HelloPoint` 46CHECK-NEXT: module = 1, sum name = 0, offset = 572 47 48CHECK-LABEL: Symbols 49CHECK-NEXT: ============================================================ 50CHECK-NEXT: Mod 0000 51CHECK-NOT: | S_GDATA32 52CHECK-NOT: | S_UDT 53CHECK-NOT: | S_GTHREAD32 54CHECK: 136 | S_GPROC32 [size = 52] `GlobalFunc` 55CHECK: 224 | S_GPROC32 [size = 44] `main` 56CHECK: 424 | S_LPROC32 [size = 52] `LocalFunc` 57CHECK: 512 | S_LDATA32 [size = 28] `ConstantVar` 58CHECK: 540 | S_LTHREAD32 [size = 24] `StaticTLS` 59CHECK: 572 | S_GPROC32 [size = 64] `HelloPoint::HelloPoint` 60