1; REQUIRES: x86
2; RUN: llc -mtriple=i686-pc-windows-msvc -filetype=obj -o %T/lto-lazy-reference-quadruple.obj %S/Inputs/lto-lazy-reference-quadruple.ll
3; RUN: llvm-as -o %T/lto-lazy-reference-dummy.bc %S/Inputs/lto-lazy-reference-dummy.ll
4; RUN: rm -f %t.lib
5; RUN: llvm-ar cru %t.lib %T/lto-lazy-reference-quadruple.obj %T/lto-lazy-reference-dummy.bc
6; RUN: llvm-as -o %t.obj %s
7; RUN: lld-link /out:%t.exe /entry:main /subsystem:console %t.obj %t.lib
8
9target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
10target triple = "i686-pc-windows-msvc18.0.0"
11
12; Define fltused, since we don't link against the MS C runtime but are
13; using floats.
14@_fltused = dllexport global i32 0, align 4
15
16define double @main(double %x) {
17entry:
18  ; When compiled, this defines the __real@40800000 symbol, which already has a
19  ; lazy definition in the lib file from  lto-lazy-reference-quadruple.obj. This
20  ; test makes sure we *don't* try to take the definition from the lazy
21  ; reference, because that can bring in new references to bitcode files after
22  ; LTO, such as lto-lazy-reference-dummy.bc in this case.
23  %mul = fmul double %x, 4.0
24
25  ret double %mul
26}
27