[PATCH] D104008: [ms] [llvm-ml] Warn on command-line redefinition

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 08:50:22 PDT 2021


thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.

LG with tweak below



================
Comment at: llvm/test/tools/llvm-ml/command_line_defines_errors.asm:1
+; RUN: not llvm-ml -filetype=s %s /Fo - /Dtest1=def /WX 2>&1 | FileCheck %s --implicit-check-not=error: --implicit-check-not=warning:
+
----------------
epastor wrote:
> thakis wrote:
> > epastor wrote:
> > > I couldn't get lit to just detect the warning, for some reason. I'm open to suggestions!
> > Hm, works for me:
> > 
> > ```
> > ; RUN: llvm-ml -filetype=s %s /Fo - /Dtest1=def 2>&1 | FileCheck %s --implicit-check-not=warning:
> > 
> > .code
> > 
> > ; CHECK: :[[# @LINE + 1]]:1: warning: redefining 'test1', already defined on the command line
> > test1 textequ <redef>
> > 
> > end
> > ```
> > 
> > ```
> > % out/gn/bin/llvm-lit -s -vv llvm/test/tools/llvm-ml/command_line_defines_errors.asm
> > 
> > 
> > Testing Time: 0.13s
> >   Passed: 1
> > ```
> ... darn, I would've sworn I tried that, but apparently I kept putting it in the other file - forgetting that CHECK always requires lines to occur in order, and that the warning is emitted before any of the output lines I'm checking against.
> 
> Thanks!
You don't need the implicit check not for error: if there's an error the command will exit non-0 and lit will fail the test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104008



More information about the llvm-commits mailing list