[PATCH] D54769: [FileCheck] New option -warn

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 12:36:19 PST 2018


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: jdenny, probinson.
Herald added subscribers: kristof.beyls, javed.absar.

This adds new option -warn to FileCheck. We would like FileCheck to
produce diagnostics indicating possible test case issues when this
options is enabled. The motiving example taken from https://reviews.llvm.org/D53710 is this:

      
  RUN: llc -mtriple=arm-linux-gnueabi %s -o - | FileCheck %s -check-prefix=FOO
  define void @FOO() {
  entry:
  ; FOO-LABEL: FOO:
  ; ZOO:       mov  pc, lr
    ret void
  }
      

The problem here is that we're not really checking anything, because
non-LABEL prefix "DOO" isn't checked with -check-prefix: FOO is, but
ZOO isn't, which can easily happen when a typo is made.

      

This is the initial bit of plumbing to add a new option, under which
we can later emit diagnostics.

      

To test this new option, I've promoted an existing verbosity message that
probably deserves to be more than just a verbosity message to a warning,
so that we now emit a diagnostic which we can test.


https://reviews.llvm.org/D54769

Files:
  include/llvm/Support/FileCheck.h
  lib/Support/FileCheck.cpp
  test/FileCheck/check-overlap-warning.txt
  test/FileCheck/verbose.txt
  utils/FileCheck/FileCheck.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54769.174823.patch
Type: text/x-patch
Size: 3941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181120/c2fe7706/attachment.bin>


More information about the llvm-commits mailing list