[FileCheck] Report missing prefixes when more than one is provided.
authorMircea Trofin <mtrofin@google.com>
Thu, 29 Oct 2020 00:44:13 +0000 (17:44 -0700)
committerMircea Trofin <mtrofin@google.com>
Fri, 30 Oct 2020 19:39:29 +0000 (12:39 -0700)
commit871d658c9ceb391df34e43d8f7af596c0b8a36df
tree9a36a81b62496e154949a53dcbb9f684527e9fda
parent5d9c80a6e6e0d6e0991030abb5623a2e3c9fa74b
[FileCheck] Report missing prefixes when more than one is provided.

If more than a prefix is provided - e.g. --check-prefixes=CHECK,FOO - we
don't report if (say) FOO is never used. This may lead to a gap in our
test coverage.

This patch introduces a new option, --allow-unused-prefixes. It
currently is set to true, keeping today's behavior. After we explicitly
set it in tests where this behavior was actually intentional, we will
switch it to false by default.

Differential Revision: https://reviews.llvm.org/D90281
llvm/include/llvm/FileCheck/FileCheck.h
llvm/lib/FileCheck/FileCheck.cpp
llvm/test/FileCheck/Inputs/one-check.txt [new file with mode: 0644]
llvm/test/FileCheck/allow-unused-prefixes.txt [new file with mode: 0644]
llvm/utils/FileCheck/FileCheck.cpp