1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[ms] [llvm-ml] Fix parity errors in error handling for INCLUDE directive

Also adds basic testing for "include" directive.

Differential Revision: https://reviews.llvm.org/D103980
This commit is contained in:
Eric Astor 2021-06-09 13:34:18 -04:00
parent 983067128e
commit e3d685ea21
3 changed files with 28 additions and 2 deletions

View File

@ -5889,9 +5889,9 @@ bool MasmParser::parseDirectiveInclude() {
std::string Filename;
SMLoc IncludeLoc = getTok().getLoc();
if (!parseAngleBracketString(Filename))
if (parseAngleBracketString(Filename))
Filename = parseStringTo(AsmToken::EndOfStatement);
if (check(!Filename.empty(), "missing filename in 'include' directive") ||
if (check(Filename.empty(), "missing filename in 'include' directive") ||
check(getTok().isNot(AsmToken::EndOfStatement),
"unexpected token in 'include' directive") ||
// Attempt to switch the lexer to the included file before consuming the

View File

@ -0,0 +1,20 @@
# RUN: llvm-ml -filetype=s %s /I %S /Fo - | FileCheck %s
include included.inc
.code
t1:
mov eax, Const
; CHECK-LABEL: t1:
; CHECK-NEXT: mov eax, 8
t2:
push_pop ebx
; CHECK-LABEL: t2:
; CHECK-NEXT: push ebx
; CHECK-NEXT: pop ebx
end

View File

@ -0,0 +1,6 @@
Const equ 00008H
push_pop macro Reg
push Reg
pop Reg
endm