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

Eric Astor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 10:34:58 PDT 2021


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc8d6e67d53a0: [ms] [llvm-ml] Fix parity errors in error handling for INCLUDE directive (authored by epastor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103980/new/

https://reviews.llvm.org/D103980

Files:
  llvm/lib/MC/MCParser/MasmParser.cpp
  llvm/test/tools/llvm-ml/include.asm
  llvm/test/tools/llvm-ml/included.inc


Index: llvm/test/tools/llvm-ml/included.inc
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-ml/included.inc
@@ -0,0 +1,6 @@
+Const equ 00008H
+
+push_pop macro Reg
+  push Reg
+  pop Reg
+endm
Index: llvm/test/tools/llvm-ml/include.asm
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-ml/include.asm
@@ -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
Index: llvm/lib/MC/MCParser/MasmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/MasmParser.cpp
+++ llvm/lib/MC/MCParser/MasmParser.cpp
@@ -5889,9 +5889,9 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103980.350948.patch
Type: text/x-patch
Size: 1465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210609/6b5ab8c2/attachment.bin>


More information about the llvm-commits mailing list