From d81c059c3ed22e7f52eb995599e576abd30eb895 Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Sun, 13 Jun 2021 18:27:06 -0400 Subject: [PATCH] [ms] [llvm-ml] Fix capitalization of the ignored CPU directives These directives are matched in lowercase, so make sure to use lowercase for their P suffix. Differential Revision: https://reviews.llvm.org/D104206 --- llvm/lib/MC/MCParser/COFFMasmParser.cpp | 8 ++++---- llvm/test/tools/llvm-ml/ml32-context.asm | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 llvm/test/tools/llvm-ml/ml32-context.asm diff --git a/llvm/lib/MC/MCParser/COFFMasmParser.cpp b/llvm/lib/MC/MCParser/COFFMasmParser.cpp index 95128cf..f745605 100644 --- a/llvm/lib/MC/MCParser/COFFMasmParser.cpp +++ b/llvm/lib/MC/MCParser/COFFMasmParser.cpp @@ -138,14 +138,14 @@ class COFFMasmParser : public MCAsmParserExtension { // Processor directives; all ignored addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386"); - addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386P"); + addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".386p"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".387"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486"); - addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486P"); + addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".486p"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586"); - addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586P"); + addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".586p"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686"); - addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686P"); + addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".686p"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".k3d"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".mmx"); addDirectiveHandler<&COFFMasmParser::IgnoreDirective>(".xmm"); diff --git a/llvm/test/tools/llvm-ml/ml32-context.asm b/llvm/test/tools/llvm-ml/ml32-context.asm new file mode 100644 index 0000000..ab949e5 --- /dev/null +++ b/llvm/test/tools/llvm-ml/ml32-context.asm @@ -0,0 +1,12 @@ +# RUN: llvm-ml -m32 -filetype=s %s /Fo - | FileCheck %s + +.386p +.model flat + +.code +mov eax, eax +end + +; CHECK-NOT: 386p +; CHECK-NOT: model +; CHECK-NOT: flat -- 2.7.4