X86: Emit _fltused instead of __fltused on Windows x64.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 23 Oct 2010 09:06:59 +0000 (09:06 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Sat, 23 Oct 2010 09:06:59 +0000 (09:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp
test/CodeGen/X86/fltused.ll

index f7cb9e71f67167b584d7c887276d474919d23c0e..5cb73bec6a4e05f660fada46d6a31ebf065f036f 100644 (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);
   }
 
index a89602129050a02e4ceb4006faffc43c6baed75b..2ffcb966782afdc9ce57022853afaa7f24860bdd 100644 (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