1; Test requiring LTO to remove the __imp_ prefix for locally imported COFF 2; symbols (mirroring how lld handles these symbols). 3; RUN: llvm-as %s -o %t.obj 4; RUN: llvm-as %S/Inputs/dllimport.ll -o %t2.obj 5; RUN: llvm-lto2 run -r=%t.obj,main,px -r %t.obj,__imp_?foo@@YAHXZ -r %t2.obj,?foo@@YAHXZ,p -o %t3 %t.obj %t2.obj -save-temps 6; RUN: llvm-dis %t3.0.0.preopt.bc -o - | FileCheck %s 7 8; CHECK: define dso_local i32 @"?foo@@YAHXZ"() 9 10; ModuleID = 'a.obj' 11source_filename = "a.cpp" 12target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 13target triple = "x86_64-pc-windows-msvc19.11.0" 14 15; Function Attrs: norecurse nounwind sspstrong uwtable 16define dso_local i32 @main() local_unnamed_addr { 17entry: 18 %call = tail call i32 @"?foo@@YAHXZ"() 19 ret i32 %call 20} 21 22declare dllimport i32 @"?foo@@YAHXZ"() local_unnamed_addr 23 24!llvm.module.flags = !{!1} 25 26!1 = !{i32 1, !"ThinLTO", i32 0} 27 28^0 = module: (path: "a.obj", hash: (0, 0, 0, 0, 0)) 29^1 = gv: (name: "?foo@@YAHXZ") ; guid = 2709792123250749187 30^2 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 1, live: 0, dsoLocal: 1), insts: 2, funcFlags: (readNone: 0, readOnly: 0, noRecurse: 1, returnDoesNotAlias: 0), calls: ((callee: ^1))))) ; guid = 15822663052811949562 31