3 // Check that wrapping works when the wrapped symbol is imported from a
4 // different DLL, redirecting references that used to point at the import
5 // thunk, towards the local wrap function instead.
7 // RUN: split-file %s %t.dir
8 // RUN: llc %t.dir/main.ll -o %t.main.obj --filetype=obj
9 // RUN: llvm-as %t.dir/main.ll -o %t.main.bc
10 // RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/lib.s -o %t.lib.obj
12 // RUN: lld-link -dll -out:%t.lib.dll %t.lib.obj -noentry -export:func -implib:%t.lib.lib
13 // RUN: lld-link -out:%t.exe %t.main.obj %t.lib.lib -entry:entry -subsystem:console -wrap:func
14 // RUN: lld-link -out:%t.exe %t.main.bc %t.lib.lib -entry:entry -subsystem:console -wrap:func
17 target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
18 target triple = "x86_64-w64-windows-gnu"
22 define void @entry() {
27 declare void @__real_func()
29 define void @__wrap_func() {
30 call void @__real_func()