From 7c7cbd26699aac513b741f10ad1fac95569ac7df Mon Sep 17 00:00:00 2001 From: Toma Tabacu Date: Thu, 14 May 2015 13:42:10 +0000 Subject: [PATCH] [mips] [IAS] Emit .set macro/nomacro. 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 | 2 ++ test/MC/Mips/mips_directives.s | 2 ++ test/MC/Mips/module-directive-bad.s | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 45169b70513..c503083028a 100644 --- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -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; } diff --git a/test/MC/Mips/mips_directives.s b/test/MC/Mips/mips_directives.s index 1a7d61f3ad4..2ea37822f76 100644 --- a/test/MC/Mips/mips_directives.s +++ b/test/MC/Mips/mips_directives.s @@ -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] diff --git a/test/MC/Mips/module-directive-bad.s b/test/MC/Mips/module-directive-bad.s index 963d651afe5..74dc6d22793 100644 --- a/test/MC/Mips/module-directive-bad.s +++ b/test/MC/Mips/module-directive-bad.s @@ -203,7 +203,7 @@ .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 @@ -211,7 +211,7 @@ .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 -- 2.34.1