Skip to content

Commit

Permalink
[SPARC]: recognize '.' as the start of an assembler expression.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245232 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
snuglas committed Aug 17, 2015
1 parent 9daba6f commit 9db597e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &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;
Expand Down
7 changes: 7 additions & 0 deletions test/MC/Sparc/sparc-assembly-exprs.s
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9db597e

Please sign in to comment.