38 lines · plain
1// REQUIRES: x862 3// Check that wrapping works when the wrapped symbol is imported from a4// different DLL, redirecting references that used to point at the import5// thunk, towards the local wrap function instead.6 7// RUN: split-file %s %t.dir8// RUN: llc %t.dir/main.ll -o %t.main.obj --filetype=obj9// RUN: llvm-as %t.dir/main.ll -o %t.main.bc10// RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/lib.s -o %t.lib.obj11 12// RUN: lld-link -dll -out:%t.lib.dll %t.lib.obj -noentry -export:func -implib:%t.lib.lib13// RUN: lld-link -out:%t.exe %t.main.obj %t.lib.lib -entry:entry -subsystem:console -wrap:func14// RUN: lld-link -out:%t.exe %t.main.bc %t.lib.lib -entry:entry -subsystem:console -wrap:func15 16#--- main.ll17target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"18target triple = "x86_64-w64-windows-gnu"19 20declare void @func()21 22define void @entry() {23 call void @func()24 ret void25}26 27declare void @__real_func()28 29define void @__wrap_func() {30 call void @__real_func()31 ret void32}33 34#--- lib.s35.global func36func:37 ret38