Index: lib/MC/MCParser/ELFAsmParser.cpp =================================================================== --- lib/MC/MCParser/ELFAsmParser.cpp +++ lib/MC/MCParser/ELFAsmParser.cpp @@ -247,7 +247,7 @@ return false; } - while (true) { + while (!getParser().hasPendingError()) { SMLoc PrevLoc = getLexer().getLoc(); if (getLexer().is(AsmToken::Comma) || getLexer().is(AsmToken::EndOfStatement)) Index: test/MC/AsmParser/Inputs/non-english-characters-comments.s =================================================================== --- test/MC/AsmParser/Inputs/non-english-characters-comments.s +++ test/MC/AsmParser/Inputs/non-english-characters-comments.s @@ -0,0 +1,10 @@ +# 0bム +# 0xム +# .ム4 +# .Xム +# .1ム +# .1eム +# 0x.ム +# 0x0pム +.intel_syntax +# 1ム Index: test/MC/AsmParser/Inputs/non-english-characters-section-name.s =================================================================== --- test/MC/AsmParser/Inputs/non-english-characters-section-name.s +++ test/MC/AsmParser/Inputs/non-english-characters-section-name.s @@ -0,0 +1 @@ +.section .ñ Index: test/MC/AsmParser/non-english-characters.s =================================================================== --- test/MC/AsmParser/non-english-characters.s +++ test/MC/AsmParser/non-english-characters.s @@ -1,14 +1,9 @@ -# RUN: llvm-mc -triple i386-linux-gnu -filetype=obj -o %t %s +# RUN: llvm-mc -triple i386-linux-gnu -filetype=obj -o %t \ +# RUN: %S/Inputs/non-english-characters-comments.s # RUN: llvm-readobj %t | FileCheck %s # CHECK: Format: ELF32-i386 -# 0bム -# 0xム -# .ム4 -# .Xム -# .1ム -# .1eム -# 0x.ム -# 0x0pム -.intel_syntax -# 1ム +# RUN: not llvm-mc -triple i386-linux-gnu -filetype=obj -o %t \ +# RUN: %S/Inputs/non-english-characters-section-name.s 2>&1 | \ +# RUN: FileCheck %s --check-prefix=ERR +# ERR: invalid character in input