diff --git a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp index cb7833d2e2b..02e9671697a 100644 --- a/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp +++ b/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp @@ -796,6 +796,7 @@ SparcAsmParser::parseSparcAsmOperand(std::unique_ptr &Op, case AsmToken::Minus: case AsmToken::Integer: case AsmToken::LParen: + case AsmToken::Dot: if (!getParser().parseExpression(EVal, E)) Op = SparcOperand::CreateImm(EVal, S, E); break; diff --git a/test/MC/Sparc/sparc-assembly-exprs.s b/test/MC/Sparc/sparc-assembly-exprs.s index 7fdc5a50345..b6f8e09e032 100644 --- a/test/MC/Sparc/sparc-assembly-exprs.s +++ b/test/MC/Sparc/sparc-assembly-exprs.s @@ -4,3 +4,10 @@ mov (0x400|9), %o1 ! CHECK: mov 60, %o2 ! encoding: [0x94,0x10,0x20,0x3c] mov (12+3<<2), %o2 + +! "." is exactly like a temporary symbol equated to the current line. +! RUN: llvm-mc %s -arch=sparc | FileCheck %s --check-prefix=DOTEXPR + + ! DOTEXPR: .Ltmp0 + ! DOTEXPR-NEXT: ba .Ltmp0+8 + b . + 8