summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/TargetLibraryInfo.cpp2
-rw-r--r--llvm/test/MC/X86/x86-windows-itanium-libcalls.ll16
2 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetLibraryInfo.cpp b/llvm/lib/Target/TargetLibraryInfo.cpp
index 6ec0b1f929c..6ff7441bbd3 100644
--- a/llvm/lib/Target/TargetLibraryInfo.cpp
+++ b/llvm/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/llvm/test/MC/X86/x86-windows-itanium-libcalls.ll b/llvm/test/MC/X86/x86-windows-itanium-libcalls.ll
new file mode 100644
index 00000000000..773d03b4def
--- /dev/null
+++ b/llvm/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
+
OpenPOWER on IntegriCloud