]> granicus.if.org Git - llvm/commitdiff
[FileCheck] Add --check-prefixes as a shorthand for multiple --check-prefix options.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 14 Jun 2016 14:28:04 +0000 (14:28 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 14 Jun 2016 14:28:04 +0000 (14:28 +0000)
Summary:
This new alias takes a comma separated list of prefixes which allows
'--check-prefix=A --check-prefix=B --check-prefix=C' to be written as
'--check-prefixes=A,B,C'.

Reviewers: probinson

Subscribers: probinson, llvm-commits, dsanders

Differential Revision: http://reviews.llvm.org/D21293

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272670 91177308-0d34-0410-b5e6-96231b3b80d8

test/FileCheck/check-multiple-prefixes-mixed.txt
test/FileCheck/check-multiple-prefixes-nomatch-2.txt
test/FileCheck/check-multiple-prefixes-nomatch.txt
test/FileCheck/multiple-missing-prefixes.txt
utils/FileCheck/FileCheck.cpp

index cd3b70a425ec3d37e782b314f198fdad02c91f62..1e6bcbf3e72a111848094a5878cc09940e1dc69a 100644 (file)
@@ -1,5 +1,7 @@
 // RUN: FileCheck -check-prefix=B -check-prefix=BOTH -input-file %s %s
 // RUN: FileCheck -check-prefix=A -check-prefix=BOTH -input-file %s %s
+// RUN: FileCheck -check-prefixes=B,BOTH -input-file %s %s
+// RUN: FileCheck -check-prefixes=A,BOTH -input-file %s %s
 
 ; A: {{a}}aaaaa
 ; B: {{b}}bbbb
index a1dc3d87b0179a139f8adbf295cbe247861d4610..605547167e9e75f76fd77133d3825593ef90b876 100644 (file)
@@ -1,4 +1,6 @@
 ; RUN: not FileCheck -input-file %s %s -check-prefix=FOO -check-prefix=BAR 2>&1 | FileCheck %s
+; RUN: not FileCheck -input-file %s %s -check-prefixes=FOO,BAR 2>&1 | FileCheck %s
+; RUN: not FileCheck -input-file %s %s -check-prefixes=BAR,FOO 2>&1 | FileCheck %s
 
 fog
 bar
index 9d3835985f34790aad5b3cada159ed8e431eb487..b1a41321c08d99b3a707aa2b07fb2a284255a0b1 100644 (file)
@@ -1,4 +1,6 @@
 ; RUN: not FileCheck -input-file %s %s -check-prefix=FOO -check-prefix=BAR 2>&1 | FileCheck %s
+; RUN: not FileCheck -input-file %s %s -check-prefixes=FOO,BAR 2>&1 | FileCheck %s
+; RUN: not FileCheck -input-file %s %s -check-prefixes=BAR,FOO 2>&1 | FileCheck %s
 
 BAR
 bar
index cb557d9f26051dbe1b085693a187e4f1f5afaef8..0acb8f0b3ed4282fe96e2b41ceda5702ed4fe7b0 100644 (file)
@@ -1,5 +1,6 @@
 // RUN: FileCheck -check-prefix=ANOTHER-PREFIX -input-file %s %s
 // RUN: not FileCheck -check-prefix=PREFIX1 -check-prefix=PREFIX2 -input-file %s %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK-NONEXISTENT-PREFIX -check-prefix=ALSO-NONEXISTENT %s
+// RUN: not FileCheck -check-prefixes=PREFIX1,PREFIX2 -input-file %s %s 2>&1 | FileCheck -strict-whitespace -check-prefixes=CHECK-NONEXISTENT-PREFIX,ALSO-NONEXISTENT %s
 
 foobar
 ; ANOTHER-PREFIX: foobar
index b895d0744f7bcf82b38bb8dc31b15462a6c64279..6c9b62d5b244247ac5fa3eafe15ccf920d8e442c 100644 (file)
@@ -45,6 +45,11 @@ InputFilename("input-file", cl::desc("File to check (defaults to stdin)"),
 static cl::list<std::string>
 CheckPrefixes("check-prefix",
               cl::desc("Prefix to use from check file (defaults to 'CHECK')"));
+static cl::alias CheckPrefixesAlias(
+    "check-prefixes", cl::aliasopt(CheckPrefixes), cl::CommaSeparated,
+    cl::NotHidden,
+    cl::desc(
+        "Alias for -check-prefix permitting multiple comma separated values"));
 
 static cl::opt<bool>
 NoCanonicalizeWhiteSpace("strict-whitespace",