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:
parent
983067128e
commit
e3d685ea21
@ -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
|
||||
|
20
test/tools/llvm-ml/include.asm
Normal file
20
test/tools/llvm-ml/include.asm
Normal 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
|
6
test/tools/llvm-ml/included.inc
Normal file
6
test/tools/llvm-ml/included.inc
Normal file
@ -0,0 +1,6 @@
|
||||
Const equ 00008H
|
||||
|
||||
push_pop macro Reg
|
||||
push Reg
|
||||
pop Reg
|
||||
endm
|
Loading…
Reference in New Issue
Block a user