X86: Emit _fltused instead of __fltused on Windows x64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer 2010-10-23 09:06:59 +00:00
parent 19e57025d4
commit c527407010
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}

View File

@ -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