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