1; REQUIRES: x86
2; RUN: rm -fr %T/thinlto-whole-archives
3; RUN: mkdir %T/thinlto-whole-archives %T/thinlto-whole-archives/a %T/thinlto-whole-archives/b
4; RUN: opt -thinlto-bc -o %T/thinlto-whole-archives/main.obj %s
5; RUN: opt -thinlto-bc -o %T/thinlto-whole-archives/a/bar.obj %S/Inputs/lto-dep.ll
6; RUN: opt -thinlto-bc -o %T/thinlto-whole-archives/b/bar.obj %S/Inputs/bar.ll
7; RUN: llvm-ar crs %T/thinlto-whole-archives/a.lib %T/thinlto-whole-archives/a/bar.obj %T/thinlto-whole-archives/b/bar.obj
8; RUN: lld-link -out:%T/thinlto-whole-archives/main.exe -entry:main \
9; RUN:     -wholearchive -lldsavetemps -subsystem:console %T/thinlto-whole-archives/main.obj \
10; RUN:     %T/thinlto-whole-archives/a.lib
11; RUN: FileCheck %s < %T/thinlto-whole-archives/main.exe.resolution.txt
12
13; CHECK: {{[/\\]thinlto-whole-archives[/\\]main.obj$}}
14; CHECK: {{^-r=.*[/\\]thinlto-whole-archives[/\\]main.obj,main,px$}}
15; CHECK: {{[/\\]thinlto-whole-archives[/\\]a.libbar.obj[0-9]+$}}
16; CHECK-NEXT: {{^-r=.*[/\\]thinlto-whole-archives[/\\]a.libbar.obj[0-9]+,foo,p$}}
17; CHECK-NEXT: {{[/\\]thinlto-whole-archives[/\\]a.libbar.obj[0-9]+$}}
18; CHECK-NEXT: {{^-r=.*[/\\]thinlto-whole-archives[/\\]a.libbar.obj[0-9]+,bar,p$}}
19
20target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
21target triple = "x86_64-pc-windows-msvc"
22
23declare void @bar()
24declare void @foo()
25
26define i32 @main() {
27  call void @foo()
28  call void @bar()
29  ret i32 0
30}
31