1; REQUIRES: x86
2; RUN: rm -rf %t && mkdir -p %t && cd %t
3; RUN: opt -thinlto-bc -o main.bc %s
4; RUN: opt -thinlto-bc -o foo.bc %S/Inputs/lto-dep.ll
5
6; Even if the native object is cached, the PDB must be the same.
7; RUN: rm -rf thinltocachedir && mkdir thinltocachedir
8
9; RUN: lld-link /lldltocache:thinltocachedir /out:main.exe /entry:main /subsystem:console main.bc foo.bc /debug /pdb:main.pdb
10
11; RUN: llvm-pdbutil dump --modules main.pdb | FileCheck %s
12
13; Run again with the cache. Make sure we get the same object names.
14
15; RUN: lld-link /lldltocache:thinltocachedir /out:main.exe /entry:main /subsystem:console main.bc foo.bc /debug /pdb:main.pdb
16
17; RUN: llvm-pdbutil dump --modules main.pdb | FileCheck %s
18
19
20target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
21target triple = "x86_64-pc-windows-msvc"
22
23define i32 @main() {
24  call void @foo()
25  ret i32 0
26}
27
28declare void @foo()
29
30; CHECK:                           Modules
31; CHECK: ============================================================
32; CHECK: Mod 0000 | `{{.*}}main.exe.lto.1.obj`:
33; CHECK: Obj: `{{.*}}main.exe.lto.1.obj`:
34; CHECK: Mod 0001 | `{{.*}}main.exe.lto.2.obj`:
35; CHECK: Obj: `{{.*}}main.exe.lto.2.obj`:
36; CHECK: Mod 0002 | `* Linker *`:
37