aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp3
-rw-r--r--test/CodeGen/X86/fltused.ll6
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index f7cb9e71f6..5cb73bec6a 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -583,7 +583,8 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
if (Subtarget->isTargetWindows()
&& !Subtarget->isTargetCygMing()
&& MMI->callsExternalVAFunctionWithFloatingPointArguments()) {
- MCSymbol *S = MMI->getContext().GetOrCreateSymbol(StringRef("__fltused"));
+ StringRef SymbolName = Subtarget->is64Bit() ? "_fltused" : "__fltused";
+ MCSymbol *S = MMI->getContext().GetOrCreateSymbol(SymbolName);
OutStreamer.EmitSymbolAttribute(S, MCSA_Global);
}
diff --git a/test/CodeGen/X86/fltused.ll b/test/CodeGen/X86/fltused.ll
index a896021290..2ffcb96678 100644
--- a/test/CodeGen/X86/fltused.ll
+++ b/test/CodeGen/X86/fltused.ll
@@ -2,7 +2,8 @@
; any function is called with floating point arguments on Windows. And that it
; is not emitted otherwise.
-; RUN: llc < %s -mtriple i686-pc-win32 | FileCheck %s
+; RUN: llc < %s -mtriple i686-pc-win32 | FileCheck %s --check-prefix WIN32
+; RUN: llc < %s -mtriple x86_64-pc-win32 | FileCheck %s --check-prefix WIN64
@.str = private constant [4 x i8] c"%f\0A\00"
@@ -14,4 +15,5 @@ entry:
declare i32 @printf(i8* nocapture, ...) nounwind
-; CHECK: .globl __fltused
+; WIN32: .globl __fltused
+; WIN64: .globl _fltused