Index: lib/MC/MCParser/AsmLexer.cpp =================================================================== --- lib/MC/MCParser/AsmLexer.cpp +++ lib/MC/MCParser/AsmLexer.cpp @@ -459,8 +459,11 @@ } bool AsmLexer::isAtStartOfComment(char Char) { - // FIXME: This won't work for multi-character comment indicators like "//". - return Char == *MAI.getCommentString(); + const char *CommentString = MAI.getCommentString(); + // handle "//" specially since it is the only real two character CommentString + if (CommentString[1] == '/') + return Char == CommentString[0] && *CurPtr == CommentString[1]; + return Char == *CommentString; } bool AsmLexer::isAtStatementSeparator(const char *Ptr) { Index: test/MC/AArch64/single-slash.s =================================================================== --- /dev/null +++ test/MC/AArch64/single-slash.s @@ -0,0 +1,6 @@ +// RUN: llvm-mc -triple aarch64-none-linux-gnu < %s | FileCheck %s + +// Test that a single slash is not mistaken as the start of comment. + +//CHECK: movz x0, #0x10 + mov x0, #(32 / 2)