diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp --- a/llvm/lib/MC/MCParser/MasmParser.cpp +++ b/llvm/lib/MC/MCParser/MasmParser.cpp @@ -2125,20 +2125,6 @@ // Treat '.' as a valid identifier in this context. Lex(); IDVal = "."; - } else if (Lexer.is(AsmToken::LCurly)) { - // Treat '{' as a valid identifier in this context. - Lex(); - IDVal = "{"; - - } else if (Lexer.is(AsmToken::RCurly)) { - // Treat '}' as a valid identifier in this context. - Lex(); - IDVal = "}"; - } else if (Lexer.is(AsmToken::Star) && - getTargetParser().starIsStartOfStatement()) { - // Accept '*' as a valid start of statement. - Lex(); - IDVal = "*"; } else if (Lexer.is(AsmToken::Real)) { // Treat "." as a valid identifier in this context. IDVal = getTok().getString(); diff --git a/llvm/test/tools/llvm-ml/label_errors.asm b/llvm/test/tools/llvm-ml/label_errors.asm new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-ml/label_errors.asm @@ -0,0 +1,8 @@ +; RUN: not llvm-ml -filetype=s %s /Fo - 2>&1 \ +; RUN: | FileCheck %s --implicit-check-not="{{[0-9]+:[0-9]+: error:}}" + +.code + +; These used to be valid label names. +{: ; CHECK: [[@LINE]]:1: error: unexpected token at start of statement +}: ; CHECK: [[@LINE]]:1: error: unexpected token at start of statement