1 RUN: yaml2obj %S/Inputs/pdb-globals.yaml -o %t.obj
2 RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj
3 RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s
5 RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj /threads:1
6 RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s
7 RUN: lld-link /debug /nodefaultlib /entry:main /force /out:%t.exe /pdb:%t.pdb %t.obj /threads:2
8 RUN: llvm-pdbutil dump -symbols -globals %t.pdb | FileCheck %s
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
17 # * S_LDATA32 is copied byte for byte into both streams.
20 CHECK-LABEL: Global Symbols
21 CHECK-NEXT: ============================================================
23 CHECK-NEXT: 444 | S_UDT [size = 20] `HelloPoint`
24 CHECK-NEXT: original type = 0x1007
25 CHECK-NEXT: 240 | S_LPROCREF [size = 24] `LocalFunc`
26 CHECK-NEXT: module = 1, sum name = 0, offset = 424
27 CHECK-NEXT: 192 | S_PROCREF [size = 28] `GlobalFunc`
28 CHECK-NEXT: module = 1, sum name = 0, offset = 136
29 CHECK-NEXT: 220 | S_PROCREF [size = 20] `main`
30 CHECK-NEXT: module = 1, sum name = 0, offset = 224
31 CHECK-NEXT: 340 | S_CONSTANT [size = 24] `ConstexprVar`
32 CHECK-NEXT: type = 0x100B (const int), value = 18
33 CHECK-NEXT: 264 | S_GDATA32 [size = 28] `__purecall`
34 CHECK-NEXT: type = 0x0403 (void*), addr = 0003:0004
35 CHECK-NEXT: 292 | S_GDATA32 [size = 24] `GlobalVar`
36 CHECK-NEXT: type = 0x100C (const int*), addr = 0003:0000
37 CHECK-NEXT: 316 | S_GTHREAD32 [size = 24] `GlobalTLS`
38 CHECK-NEXT: type = 0x0074 (int), addr = 0004:0000
39 CHECK-NEXT: 392 | S_LTHREAD32 [size = 24] `StaticTLS`
40 CHECK-NEXT: type = 0x0074 (int), addr = 0004:0004
41 CHECK-NEXT: 416 | S_UDT [size = 28] `HelloPointTypedef`
42 CHECK-NEXT: original type = 0x1007
43 CHECK-NEXT: 364 | S_LDATA32 [size = 28] `ConstantVar`
44 CHECK-NEXT: type = 0x100B (const int), addr = 0002:0000
45 CHECK-NEXT: 464 | S_PROCREF [size = 40] `HelloPoint::HelloPoint`
46 CHECK-NEXT: module = 1, sum name = 0, offset = 572
49 CHECK-NEXT: ============================================================
51 CHECK-NOT: | S_GDATA32
53 CHECK-NOT: | S_GTHREAD32
54 CHECK: 136 | S_GPROC32 [size = 52] `GlobalFunc`
55 CHECK: 224 | S_GPROC32 [size = 44] `main`
56 CHECK: 424 | S_LPROC32 [size = 52] `LocalFunc`
57 CHECK: 512 | S_LDATA32 [size = 28] `ConstantVar`
58 CHECK: 540 | S_LTHREAD32 [size = 24] `StaticTLS`
59 CHECK: 572 | S_GPROC32 [size = 64] `HelloPoint::HelloPoint`