summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/Mips
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-07-25 07:07:43 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-07-25 07:07:43 +0000
commitb5244592882f296097bcd5508630b73311d0ddde (patch)
treea5a4a22d0466ba76dcc8202f37313c80cd97e8ab /llvm/test/MC/Mips
parent4eab1ba6196b9d5dd8b5980d076e52b0672cb3bd (diff)
downloadbcm5719-llvm-b5244592882f296097bcd5508630b73311d0ddde.tar.gz
bcm5719-llvm-b5244592882f296097bcd5508630b73311d0ddde.zip
[mips] Replace custom parsing logic for data directives by the `addAliasForDirective`
The target independent AsmParser doesn't recognise .hword, .word, .dword which are required for Mips. Currently MipsAsmParser recognises these through dispatch to MipsAsmParser::parseDataDirective. This contains equivalent logic to AsmParser::parseDirectiveValue. This patch allows reuse of AsmParser::parseDirectiveValue by making use of addAliasForDirective to support .hword, .word and .dword. Original patch provided by Alex Bradbury at D47001 was modified to fix handling of microMIPS symbols. The `AsmParser::parseDirectiveValue` calls either `EmitIntValue` or `EmitValue`. In this patch we override `EmitIntValue` in the `MipsELFStreamer` to clear a pending set of microMIPS symbols. Differential revision: https://reviews.llvm.org/D49539 llvm-svn: 337893
Diffstat (limited to 'llvm/test/MC/Mips')
-rw-r--r--llvm/test/MC/Mips/micromips-label-test.s46
1 files changed, 45 insertions, 1 deletions
diff --git a/llvm/test/MC/Mips/micromips-label-test.s b/llvm/test/MC/Mips/micromips-label-test.s
index 39c905c06db..357287ede7b 100644
--- a/llvm/test/MC/Mips/micromips-label-test.s
+++ b/llvm/test/MC/Mips/micromips-label-test.s
@@ -9,6 +9,16 @@ g:
nop
h:
.word 0
+k:
+ .long 0
+l:
+ .hword 0
+m:
+ .2byte 0
+n:
+ .4byte 0
+o:
+ .8byte 0
i:
nop
j:
@@ -54,5 +64,39 @@ j:
# CHECK: Other: 0
# CHECK: Section: .text
# CHECK: }
+# CHECK: Symbol {
+# CHECK: Name: k
+# CHECK: Binding: Local
+# CHECK: Type: None
+# CHECK: Other: 0
+# CHECK: Section: .text
+# CHECK: }
+# CHECK: Symbol {
+# CHECK: Name: l
+# CHECK: Binding: Local
+# CHECK: Type: None
+# CHECK: Other: 0
+# CHECK: Section: .text
+# CHECK: }
+# CHECK: Symbol {
+# CHECK: Name: m
+# CHECK: Binding: Local
+# CHECK: Type: None
+# CHECK: Other: 0
+# CHECK: Section: .text
+# CHECK: }
+# CHECK: Symbol {
+# CHECK: Name: n
+# CHECK: Binding: Local
+# CHECK: Type: None
+# CHECK: Other: 0
+# CHECK: Section: .text
+# CHECK: }
+# CHECK: Symbol {
+# CHECK: Name: o
+# CHECK: Binding: Local
+# CHECK: Type: None
+# CHECK: Other: 0
+# CHECK: Section: .text
+# CHECK: }
# CHECK: ]
-
OpenPOWER on IntegriCloud