From 7eef54e612e5ac7fc2fac660bdc5d7c21a071b57 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 4 Aug 2014 04:27:37 +0000 Subject: [PATCH] Merging r213883: ------------------------------------------------------------------------ r213883 | compnerd | 2014-07-24 10:46:36 -0700 (Thu, 24 Jul 2014) | 5 lines X86: correct library call setup for Windows itanium This target is identical to the Windows MSVC (and follows Microsoft ABI for C). Correct the library call setup for this target. The same set of library calls are missing on this environment. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@214686 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetLibraryInfo.cpp | 2 +- test/MC/X86/x86-windows-itanium-libcalls.ll | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/MC/X86/x86-windows-itanium-libcalls.ll diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp index 6ec0b1f929c..6ff7441bbd3 100644 --- a/lib/Target/TargetLibraryInfo.cpp +++ b/lib/Target/TargetLibraryInfo.cpp @@ -426,7 +426,7 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T, TLI.setUnavailable(LibFunc::fiprintf); } - if (T.isKnownWindowsMSVCEnvironment()) { + if (T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) { // Win32 does not support long double TLI.setUnavailable(LibFunc::acosl); TLI.setUnavailable(LibFunc::asinl); diff --git a/test/MC/X86/x86-windows-itanium-libcalls.ll b/test/MC/X86/x86-windows-itanium-libcalls.ll new file mode 100644 index 00000000000..773d03b4def --- /dev/null +++ b/test/MC/X86/x86-windows-itanium-libcalls.ll @@ -0,0 +1,16 @@ +; RUN: opt -mtriple i686-windows-itanium -O2 -o - %s | llvm-dis | FileCheck %s + +target triple = "i686-windows-itanium" + +declare dllimport double @floor(double) + +define dllexport float @test(float %f) { + %conv = fpext float %f to double + %call = tail call double @floor(double %conv) + %cast = fptrunc double %call to float + ret float %cast +} + +; CHECK-NOT: floorf +; CHECK: floor +