[mips] Do not emit ".option pic0" if target is mips64.
authorAkira Hatanaka <ahatanaka@mips.com>
Wed, 26 Jun 2013 19:08:49 +0000 (19:08 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Wed, 26 Jun 2013 19:08:49 +0000 (19:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185012 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MipsAsmPrinter.cpp
test/MC/Mips/abicalls.ll

index bab70afd398e50d606b761a02bc63098b25c9d3a..c037c0502e75cdf387572b25bd83133f9e4525e4 100644 (file)
@@ -562,7 +562,7 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
   if (OutStreamer.hasRawTextSupport()) {
     OutStreamer.EmitRawText(StringRef("\t.abicalls"));
     Reloc::Model RM = Subtarget->getRelocationModel();
-    if (RM == Reloc::Static)
+    if (RM == Reloc::Static && !Subtarget->hasMips64())
       OutStreamer.EmitRawText(StringRef("\t.option\tpic0"));
   }
 
index a93ae6d9c668222b04c154d1f8bef3600051e52c..7b98b02d05ada5ed0236a95c1ce9dc57cfe10621 100644 (file)
@@ -7,6 +7,8 @@
 
 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-STATIC %s
 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-PIC %s
+; RUN: llc -filetype=asm -mtriple mips64el-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-PIC %s
+
 ; CHECK-STATIC: .abicalls
 ; CHECK-STATIC-NEXT: pic0
 ; CHECK-PIC: .abicalls