Recommit: Detect incorrect FileCheck variable CLI definition
authorThomas Preud'homme <thomasp@graphcore.ai>
Tue, 5 Feb 2019 14:17:28 +0000 (14:17 +0000)
committerThomas Preud'homme <thomasp@graphcore.ai>
Tue, 5 Feb 2019 14:17:28 +0000 (14:17 +0000)
commita5e233bf798e8045771aa20af0e8b39cb60a6d73
tree9f53ebeda85eb85d582bf514f37d7fbff5a64aea
parentf929a0f81b6f75f880796b3716ab8a858a764de9
Recommit: Detect incorrect FileCheck variable CLI definition

Summary:
While the backend code of FileCheck relies on definition of variable
from the command-line to have an equal sign '=' and a variable name
before that, the frontend does not actually enforce it. This leads to
FileCheck crashing when invoked with invalid syntax for the -D option.

This patch adds the missing validation in the frontend. It also makes
the -D option an AlwaysPrefix option to be able to detect -D=FOO as
being a define without variable and -D as missing its value.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions)

Reviewers: jdenny

Subscribers: JonChesterfield, hiraditya, kristina, probinson,
llvm-commits

Differential Revision: https://reviews.llvm.org/D55940

llvm-svn: 353173
llvm/test/FileCheck/defines.txt
llvm/utils/FileCheck/FileCheck.cpp