Index: test/tools/llvm-mc/line_end_with_space.test =================================================================== --- test/tools/llvm-mc/line_end_with_space.test +++ test/tools/llvm-mc/line_end_with_space.test @@ -0,0 +1,2 @@ +RUN: llvm-mc -disassemble %s + \ No newline at end of file Index: tools/llvm-mc/Disassembler.cpp =================================================================== --- tools/llvm-mc/Disassembler.cpp +++ tools/llvm-mc/Disassembler.cpp @@ -106,7 +106,7 @@ // If this is the end of a line or start of a comment, remove the rest of // the line. - if (Str[0] == '\n' || Str[0] == '#') { + else if (Str[0] == '\n' || Str[0] == '#') { // Strip to the end of line if we already processed any bytes on this // line. This strips the comment and/or the \n. if (Str[0] == '\n') {