diff --git a/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp b/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp --- a/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp +++ b/llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp @@ -133,7 +133,6 @@ SMLoc Start, End; union { StringRef Token; - int64_t Imm; const MCExpr *Expr; M68kMemOp MemOp; }; @@ -1069,9 +1068,12 @@ OS << "token '" << Token << "'"; break; - case KindTy::Imm: - OS << "immediate " << Imm; + case KindTy::Imm: { + int64_t Value; + Expr->evaluateAsAbsolute(Value); + OS << "immediate " << Value; break; + } case KindTy::MemOp: MemOp.print(OS); diff --git a/llvm/test/MC/M68k/operand.s b/llvm/test/MC/M68k/operand.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/M68k/operand.s @@ -0,0 +1,5 @@ +# RUN: llvm-mc -triple=m68k -show-inst-operands %s 2> %t0 +# RUN: FileCheck %s < %t0 + +; CHECK: parsed instruction: [token 'move.l', immediate 123, %24] +move.l #123, %d0