'{', '}' and (conditionally) '*' were allowed at the start of a
statement. This behavior was copied from AsmParser, where they were
added to support Hexagon bundles (braces) and BFP memory instructions
(the star).
MASM dialect is x86-specific and does not allow these symbols to be
used at the beginning of an instruction.
Worth noting that '{' is a valid first character in AT&T syntax
(e.g. "{vex} vpmadd52huq ..."); MASM variant is to omit the braces.
Reviewed By: epastor
Differential Revision: https://reviews.llvm.org/
D142321
// 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 ".<number>" as a valid identifier in this context.
IDVal = getTok().getString();
--- /dev/null
+; 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