Make Sparc assembler accept parenthesized constant expressions.

Differential Revision: http://reviews.llvm.org/D9087

llvm-svn: 236137
This commit is contained in:
Douglas Katzman 2015-04-29 18:48:29 +00:00
parent 66f2e12f7a
commit 9cb88b73c6
2 changed files with 7 additions and 0 deletions

View File

@ -682,6 +682,7 @@ SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &Op,
case AsmToken::Minus:
case AsmToken::Integer:
case AsmToken::LParen:
if (!getParser().parseExpression(EVal, E))
Op = SparcOperand::CreateImm(EVal, S, E);
break;

View File

@ -0,0 +1,6 @@
! RUN: llvm-mc %s -arch=sparc -show-encoding | FileCheck %s
! CHECK: mov 1033, %o1 ! encoding: [0x92,0x10,0x24,0x09]
mov (0x400|9), %o1
! CHECK: mov 60, %o2 ! encoding: [0x94,0x10,0x20,0x3c]
mov (12+3<<2), %o2