mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 07:41:38 +00:00
Fix parsing of a line with only a # in it.
llvm-svn: 142537
This commit is contained in:
parent
2145251624
commit
01d11bcdf0
@ -1228,7 +1228,8 @@ bool AsmParser::ParseStatement() {
|
||||
/// EatToEndOfLine uses the Lexer to eat the characters to the end of the line
|
||||
/// since they may not be able to be tokenized to get to the end of line token.
|
||||
void AsmParser::EatToEndOfLine() {
|
||||
Lexer.LexUntilEndOfLine();
|
||||
if (!Lexer.is(AsmToken::EndOfStatement))
|
||||
Lexer.LexUntilEndOfLine();
|
||||
// Eat EOL.
|
||||
Lex();
|
||||
}
|
||||
|
15
test/MC/AsmParser/line_with_hash.s
Normal file
15
test/MC/AsmParser/line_with_hash.s
Normal file
@ -0,0 +1,15 @@
|
||||
# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
|
||||
|
||||
// We used to incorrectly parse a line with only a # in it
|
||||
|
||||
.zero 42
|
||||
#
|
||||
.ifndef FOO
|
||||
.zero 2
|
||||
.else
|
||||
.endif
|
||||
.zero 24
|
||||
|
||||
// CHECK: .zero 42
|
||||
// CHECK-NEXT: .zero 2
|
||||
// CHECK-NEXT: .zero 24
|
Loading…
x
Reference in New Issue
Block a user