[mips] [IAS] Emit .set macro/nomacro.
authorToma Tabacu <toma.tabacu@imgtec.com>
Thu, 14 May 2015 13:42:10 +0000 (13:42 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Thu, 14 May 2015 13:42:10 +0000 (13:42 +0000)
Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237363 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/mips_directives.s
test/MC/Mips/module-directive-bad.s

index 45169b70513ba5b96f45ff5eed7db311b831d976..c503083028aed1c91ee4513c83abcbd19c7c17a8 100644 (file)
@@ -3434,6 +3434,7 @@ bool MipsAsmParser::parseSetMacroDirective() {
     return false;
   }
   AssemblerOptions.back()->setMacro();
+  getTargetStreamer().emitDirectiveSetMacro();
   Parser.Lex(); // Consume the EndOfStatement.
   return false;
 }
@@ -3451,6 +3452,7 @@ bool MipsAsmParser::parseSetNoMacroDirective() {
     return false;
   }
   AssemblerOptions.back()->setNoMacro();
+  getTargetStreamer().emitDirectiveSetNoMacro();
   Parser.Lex(); // Consume the EndOfStatement.
   return false;
 }
index 1a7d61f3ad4fb1581a30aa5c5a6408189b435da2..2ea37822f764ae2e1af25f70a0eebb0611fd252c 100644 (file)
@@ -17,6 +17,7 @@ $BB0_2:
 # CHECK-NOT: nop
 # CHECK:   jal 1328             # encoding: [0x0c,0x00,0x01,0x4c]
 # CHECK-NOT: nop
+# CHECK: .set nomacro
 
     .set    noreorder
      b 1332
@@ -33,6 +34,7 @@ $JTI0_0:
 # CHECK:     .4byte    2013265916
     .set  at=$12
     .set macro
+# CHECK:   .set macro
 # CHECK:   .set reorder
 # CHECK:   b 1332               # encoding: [0x10,0x00,0x01,0x4d]
 # CHECK:   nop                  # encoding: [0x00,0x00,0x00,0x00]
index 963d651afe5a7c03e95078e555412b33f626f03e..74dc6d22793b5c8e5f5f0993385bc358910e59b1 100644 (file)
 
     .set macro
     .module fp=64
-# FIXME: emitDirectiveSetMacro should call forbidModuleDirective().
+# CHECK: :[[@LINE-1]]:13: error: .module directive must appear before any code
 
     .llvm_internal_mips_reallow_module_directive
     .module fp=32
 
     .set nomacro
     .module fp=64
-# FIXME: emitDirectiveSetNoMacro should call forbidModuleDirective().
+# CHECK: :[[@LINE-1]]:13: error: .module directive must appear before any code
 
     .llvm_internal_mips_reallow_module_directive
     .module fp=32