2 # RUN: llvm-mc -filetype=obj %S/Inputs/pdb-global-constants-a.s -o %t-a.obj -triple x86_64-windows-msvc
3 # RUN: llvm-mc -filetype=obj %S/Inputs/pdb-global-constants-b.s -o %t-b.obj -triple x86_64-windows-msvc
4 # RUN: lld-link -entry:main -nodefaultlib %t-a.obj %t-b.obj -out:%t.exe -pdb:%t.pdb -debug
5 # RUN: llvm-pdbutil dump -globals %t.pdb | FileCheck %s
7 # Test that lld deduplicates S_CONSTANT records with the same name and value.
9 # Compiled from this C code, using
10 # clang t.cpp -g -gcodeview -S
15 # int main() { return Foo + Bar; }
20 # int foobar() { return Foo + Bar; }
23 CHECK: 88 | S_CONSTANT [size = 16] `Bar`
24 CHECK-NEXT: type = 0x1002 (const int), value = 42
25 CHECK-NEXT: 72 | S_CONSTANT [size = 16] `Foo`
26 CHECK-NEXT: type = 0x1002 (const int), value = 41
27 CHECK-NEXT: 128 | S_CONSTANT [size = 16] `Foo`
28 CHECK-NEXT: type = 0x1002 (const int), value = 42