COFF: add test for /INCLUDE directives specified in bitcode

Summary: MSVC allows linker options to be specified in source code. One of these is the /INCLUDE directive, which specifies that a symbol must be added to the symbol table, even if it otherwise wouldn't be. Existing tests cover the case where the linker is given an object file with an /INCLUDE directive, but we also need to cover the case where /INCLUDE is specified in a bitcode file (as would happen when using LTO). This new test covers that case.

Reviewers: pcc, ruiu

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D29096

llvm-svn: 293107
This commit is contained in:
Bob Haarman 2017-01-25 23:07:40 +00:00
parent fdcd18b4c9
commit 25c731874d
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
; RUN: llvm-as -o %t.obj %s
; RUN: lld-link /dll /out:%t.dll %t.obj
; RUN: llvm-objdump -d %t.dll | FileCheck %s
; Checks that code for foo is emitted, as required by the /INCLUDE directive.
; CHECK: xorl %eax, %eax
; CHECK-NEXT: retq
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"
define void @_DllMainCRTStartup() {
ret void
}
define i32 @foo() {
ret i32 0
}
!llvm.module.flags = !{!0}
!0 = !{i32 6, !"Linker Options", !1}
!1 = !{!2}
!2 = !{!"/INCLUDE:foo"}