[SPARC]: recognize '.' as the start of an assembler expression.
authorDouglas Katzman <dougk@google.com>
Mon, 17 Aug 2015 19:55:01 +0000 (19:55 +0000)
committerDouglas Katzman <dougk@google.com>
Mon, 17 Aug 2015 19:55:01 +0000 (19:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245232 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
test/MC/Sparc/sparc-assembly-exprs.s

index cb7833d2e2b29da8b041200bb99815c3b8168977..02e9671697aeaf812f329031c85aff9e51066ceb 100644 (file)
@@ -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;
index 7fdc5a50345f315768bce17da747fc736039a846..b6f8e09e0320221fe54e1ede6d80fbc479e7c4bc 100644 (file)
@@ -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