summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAlexander Richardson <arichardson.kde@gmail.com>2017-11-07 13:24:44 +0000
committerAlexander Richardson <arichardson.kde@gmail.com>2017-11-07 13:24:44 +0000
commit46e1fd61021ff06966e672cb38cba0278b9d0b0d (patch)
tree4bf34236bc55ddcc6d1358c759206e52f0f0605d /llvm/test
parent9a6b720f4fc9a40785262a74de8595eb511fb6a2 (diff)
downloadbcm5719-llvm-46e1fd61021ff06966e672cb38cba0278b9d0b0d.tar.gz
bcm5719-llvm-46e1fd61021ff06966e672cb38cba0278b9d0b0d.zip
Add a -D flag to FileCheck to define variables
Summary: This makes it very easy to test files that only differ in a constant value somewhere in the test case. Reviewers: jlebar, hfinkel, chandlerc, probinson Reviewed By: probinson Subscribers: probinson, llvm-commits Differential Revision: https://reviews.llvm.org/D39629 llvm-svn: 317572
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/FileCheck/defines.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/FileCheck/defines.txt b/llvm/test/FileCheck/defines.txt
new file mode 100644
index 00000000000..d2219b7ca25
--- /dev/null
+++ b/llvm/test/FileCheck/defines.txt
@@ -0,0 +1,9 @@
+; RUN: FileCheck -DVALUE=10 -input-file %s %s
+; RUN: not FileCheck -DVALUE=20 -input-file %s %s 2>&1 | FileCheck %s -check-prefix ERRMSG
+
+Value = 10
+; CHECK: Value = [[VALUE]]
+
+; ERRMSG: defines.txt:5:10: error: expected string not found in input
+; ERRMSG: defines.txt:1:1: note: with variable "VALUE" equal to "20"
+; ERRMSG: defines.txt:4:1: note: possible intended match here
OpenPOWER on IntegriCloud