summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Medic <Vladimir.Medic@imgtec.com>2013-11-13 13:18:04 +0000
committerVladimir Medic <Vladimir.Medic@imgtec.com>2013-11-13 13:18:04 +0000
commite10c1125dfc9a94e86f43206e2437e7fe24db521 (patch)
treea7606b9d9e6e1607be7ad2d13e17d21b459adb37
parentccb70caa13faa71ec81101e83cd350b385e34ee6 (diff)
downloadbcm5719-llvm-e10c1125dfc9a94e86f43206e2437e7fe24db521.tar.gz
bcm5719-llvm-e10c1125dfc9a94e86f43206e2437e7fe24db521.zip
Fix bug in .gpword directive parsing.
llvm-svn: 194570
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp6
-rw-r--r--llvm/test/MC/Mips/mips_directives.s3
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 7b93d751e00..89e2b3b0227 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -2379,13 +2379,11 @@ bool MipsAsmParser::parseDirectiveGpWord() {
// method to evaluate the expression.
if (getParser().parseExpression(Value))
return true;
-
getParser().getStreamer().EmitGPRel32Value(Value);
- Parser.Lex(); // Eat last token.
- if (getLexer().is(AsmToken::EndOfStatement))
+ if (getLexer().isNot(AsmToken::EndOfStatement))
return Error(getLexer().getLoc(), "unexpected token in directive");
-
+ Parser.Lex(); // Eat EndOfStatement token.
return false;
}
diff --git a/llvm/test/MC/Mips/mips_directives.s b/llvm/test/MC/Mips/mips_directives.s
index 6bd690aad60..44e707c8945 100644
--- a/llvm/test/MC/Mips/mips_directives.s
+++ b/llvm/test/MC/Mips/mips_directives.s
@@ -19,10 +19,11 @@ $BB0_2:
.set noat
$JTI0_0:
.gpword ($BB0_2)
+
.word 0x77fffffc
# CHECK: $JTI0_0:
# CHECK: .gpword ($BB0_2)
-# CHECK-NEXT: .4byte 2013265916
+# CHECK: .4byte 2013265916
.set at=$12
.set macro
# CHECK: b 1332 # encoding: [0x10,0x00,0x01,0x4d]
OpenPOWER on IntegriCloud