Skip to content

Commit 772155c

Browse files
author
Toma Tabacu
committedMay 14, 2015
[mips] [IAS] Emit .set macro/nomacro.
Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9563 llvm-svn: 237363
1 parent 70b744e commit 772155c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
 

‎llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -3434,6 +3434,7 @@ bool MipsAsmParser::parseSetMacroDirective() {
34343434
return false;
34353435
}
34363436
AssemblerOptions.back()->setMacro();
3437+
getTargetStreamer().emitDirectiveSetMacro();
34373438
Parser.Lex(); // Consume the EndOfStatement.
34383439
return false;
34393440
}
@@ -3451,6 +3452,7 @@ bool MipsAsmParser::parseSetNoMacroDirective() {
34513452
return false;
34523453
}
34533454
AssemblerOptions.back()->setNoMacro();
3455+
getTargetStreamer().emitDirectiveSetNoMacro();
34543456
Parser.Lex(); // Consume the EndOfStatement.
34553457
return false;
34563458
}

‎llvm/test/MC/Mips/mips_directives.s

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $BB0_2:
1717
# CHECK-NOT: nop
1818
# CHECK: jal 1328 # encoding: [0x0c,0x00,0x01,0x4c]
1919
# CHECK-NOT: nop
20+
# CHECK: .set nomacro
2021

2122
.set noreorder
2223
b 1332
@@ -33,6 +34,7 @@ $JTI0_0:
3334
# CHECK: .4byte 2013265916
3435
.set at=$12
3536
.set macro
37+
# CHECK: .set macro
3638
# CHECK: .set reorder
3739
# CHECK: b 1332 # encoding: [0x10,0x00,0x01,0x4d]
3840
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]

‎llvm/test/MC/Mips/module-directive-bad.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@
203203

204204
.set macro
205205
.module fp=64
206-
# FIXME: emitDirectiveSetMacro should call forbidModuleDirective().
206+
# CHECK: :[[@LINE-1]]:13: error: .module directive must appear before any code
207207

208208
.llvm_internal_mips_reallow_module_directive
209209
.module fp=32
210210
# CHECK-NOT: :[[@LINE-1]]:13: error: .module directive must appear before any code
211211

212212
.set nomacro
213213
.module fp=64
214-
# FIXME: emitDirectiveSetNoMacro should call forbidModuleDirective().
214+
# CHECK: :[[@LINE-1]]:13: error: .module directive must appear before any code
215215

216216
.llvm_internal_mips_reallow_module_directive
217217
.module fp=32

0 commit comments

Comments
 (0)
Please sign in to comment.