Currently, a LIT test named directly (on the command line) will be run even if the name of the test file does not meet the rules to be considered a test in the LIT test configuration files for its test suite. For example, if the test does not have a recognised file extension.
This makes it relatively easy to write a LIT test that won't actually be run. I did in: https://reviews.llvm.org/D82567
This patch adds an error to avoid users doing that. There is a small performance overhead for this check. A command line option has been added so that users can opt into the old behaviour.
Note to anyone reading this review in the future: The patch was initially to warn not error. I changed to error later and adjusted the Title and Summary.