2017-07-19 02:40:50 +08:00
|
|
|
; REQUIRES: x86
|
2017-03-17 05:19:36 +08:00
|
|
|
;; Make sure we re-create archive files to strip bitcode files.
|
2017-03-08 03:45:53 +08:00
|
|
|
|
2017-03-17 10:04:22 +08:00
|
|
|
;; Do not create empty archives because the MSVC linker
|
|
|
|
;; doesn't support them.
|
2017-03-08 03:45:53 +08:00
|
|
|
; RUN: llvm-as -o %t.obj %s
|
2017-03-17 05:19:36 +08:00
|
|
|
; RUN: rm -f %t-main1.a
|
2017-03-08 05:26:10 +08:00
|
|
|
; RUN: llvm-ar cru %t-main1.a %t.obj
|
2017-03-08 03:45:53 +08:00
|
|
|
; RUN: mkdir -p %t.dir
|
|
|
|
; RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o %t.dir/bitcode.obj %p/Inputs/msvclto.s
|
2017-03-08 05:26:10 +08:00
|
|
|
; RUN: lld-link %t-main1.a %t.dir/bitcode.obj /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \
|
2017-12-12 05:57:31 +08:00
|
|
|
; RUN: /entry:main /verbose 2> %t.log || true
|
2017-03-08 05:26:10 +08:00
|
|
|
; RUN: FileCheck -check-prefix=BC %s < %t.log
|
2017-03-17 10:04:22 +08:00
|
|
|
; BC-NOT: Creating a temporary archive for
|
2017-03-08 03:45:53 +08:00
|
|
|
|
2017-03-17 05:19:36 +08:00
|
|
|
; RUN: rm -f %t-main2.a
|
|
|
|
; RUN: llvm-ar cru %t-main2.a %t.dir/bitcode.obj
|
|
|
|
; RUN: lld-link %t.obj %t-main2.a /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \
|
2017-12-12 05:57:31 +08:00
|
|
|
; RUN: /entry:main /verbose 2> %t.log || true
|
2017-03-08 05:26:10 +08:00
|
|
|
; RUN: FileCheck -check-prefix=OBJ %s < %t.log
|
2017-03-17 05:19:36 +08:00
|
|
|
; OBJ-NOT: Creating a temporary archive
|
|
|
|
|
|
|
|
;; Make sure that we always rebuild thin archives because
|
|
|
|
;; the MSVC linker doesn't support thin archives.
|
|
|
|
; RUN: rm -f %t-main3.a
|
|
|
|
; RUN: llvm-ar cruT %t-main3.a %t.dir/bitcode.obj
|
|
|
|
; RUN: lld-link %t.obj %t-main3.a /msvclto /out:%t.exe /opt:lldlto=1 /opt:icf \
|
2017-12-12 05:57:31 +08:00
|
|
|
; RUN: /entry:main /verbose 2> %t.log || true
|
2017-03-17 05:19:36 +08:00
|
|
|
; RUN: FileCheck -check-prefix=THIN %s < %t.log
|
|
|
|
; THIN: Creating a temporary archive
|
2017-03-08 03:45:53 +08:00
|
|
|
|
|
|
|
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-pc-windows-msvc"
|
|
|
|
|
|
|
|
declare void @foo()
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
call void @foo()
|
|
|
|
ret i32 0
|
|
|
|
}
|