forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow multiple check prefixes in FileCheck.
This is useful if you want to run multiple variations of a single test, and the majority of check lines should be the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194343 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
15 changed files
with
353 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
; RUN: FileCheck -check-prefix=A -check-prefix=B -input-file %s %s | ||
|
||
this is the string to be matched | ||
|
||
; B-DAG: this is the string to be {{matched}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
; RUN: FileCheck -check-prefix=B -check-prefix=A -input-file %s %s | ||
|
||
this is the string to be matched | ||
|
||
; B-DAG: this is the string to be {{matched}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; RUN: FileCheck -check-prefix=A -input-file %s %s | ||
|
||
this should be matched | ||
|
||
; B-DAG: foo | ||
|
||
; A-DAG: {{this}} should be matched |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; RUN: FileCheck -check-prefix=A -check-prefix=B -input-file %s %s | ||
|
||
add r10, r1, r2 | ||
add r11, r3, r4 | ||
mul r5, r10, r11 | ||
|
||
mul r11, r3, r4 | ||
mul r10, r1, r2 | ||
add r5, r10, r11 | ||
|
||
add r11, r3, r4 | ||
add r10, r1, r2 | ||
mul r5, r10, r11 | ||
|
||
; B-DAG: add [[REG1:r[0-9]+]], r1, r2 | ||
; B-DAG: add [[REG2:r[0-9]+]], r3, r4 | ||
; B: mul r5, [[REG1]], [[REG2]] | ||
|
||
; A-DAG: mul [[REG1:r[0-9]+]], r1, r2 | ||
; A-DAG: mul [[REG2:r[0-9]+]], r3, r4 | ||
; A: add r5, [[REG1]], [[REG2]] | ||
|
||
; B-DAG: add [[REG1:r[0-9]+]], r1, r2 | ||
; B-DAG: add [[REG2:r[0-9]+]], r3, r4 | ||
; B-NOT: xor | ||
; B-DAG: mul r5, [[REG1]], [[REG2]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; RUN: not FileCheck -check-prefix=A -check-prefix=AA -input-file %s %s | ||
|
||
this is the string to be matched | ||
this should also be matched | ||
|
||
; BAA-DAG: this is the string to be {{matched}} | ||
; BAA-DAG: this should also be {{matched}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// RUN: FileCheck -check-prefix=ONE -check-prefix=TWO -input-file %s %s | ||
|
||
foo | ||
bar | ||
; ONE-LABEL: {{f}}oo | ||
; TWO-NEXT: {{b}}ar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: FileCheck -check-prefix=B -check-prefix=BOTH -input-file %s %s | ||
// RUN: FileCheck -check-prefix=A -check-prefix=BOTH -input-file %s %s | ||
|
||
; A: {{a}}aaaaa | ||
; B: {{b}}bbbb | ||
; BOTH: {{q}}qqqqq | ||
aaaaaa | ||
bbbbb | ||
qqqqqq | ||
ccccc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: FileCheck -check-prefix=FOO -check-prefix=FOOBAR -check-prefix=BARFOO -input-file %s %s | ||
; RUN: FileCheck -check-prefix=FOOBAR -check-prefix=FOO -check-prefix=BARFOO -input-file %s %s | ||
; RUN: FileCheck -check-prefix=FOOBAR -check-prefix=BARFOO -check-prefix=FOO -input-file %s %s | ||
|
||
this is the match | ||
this is another | ||
|
||
FOO | ||
FOOBAR | ||
FOOBAR: this is the {{match}} | ||
BARFOO: this is {{another}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: FileCheck -check-prefix=AAAOVERLAP -check-prefix=OVERLAP -input-file %s %s | ||
|
||
foo | ||
bar | ||
buzz | ||
|
||
OVERLAP: foo | ||
AAAOVERLAP: bar | ||
OVERLAP: buzz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
RUN: FileCheck -check-prefix=RUN -input-file %s %s | ||
// Prefix is at the first character in the file. The run line then matches itself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// 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 | ||
|
||
foobar | ||
; ANOTHER-PREFIX: foobar | ||
|
||
; We use regex to match the colon so that FileCheck won't think it is a check | ||
; prefix. | ||
; CHECK-NONEXISTENT-PREFIX: error: no check strings found with prefixes 'PREFIX1{{:}}', 'PREFIX2{{:}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// RUN: not FileCheck -check-prefix=SOMEPREFIX -input-file %s %s | ||
// RUN: FileCheck -check-prefix=ANOTHER -input-file %s %s | ||
|
||
asdf | ||
; SOMEPREFIX: {{t}}his_is_not_asdf | ||
; ANOTHER: {{a}}sdf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// RUN: not FileCheck -check-prefix=A! -input-file %s %s 2>&1 | FileCheck -check-prefix=BAD_PREFIX %s | ||
// RUN: FileCheck -check-prefix=A1a-B_c -input-file %s %s | ||
|
||
// RUN: not FileCheck -check-prefix=REPEAT -check-prefix=REPEAT -input-file %s %s 2>&1 | FileCheck -check-prefix=BAD_PREFIX %s | ||
// RUN: not FileCheck -check-prefix=VALID -check-prefix=A! -input-file %s %s 2>&1 | FileCheck -check-prefix=BAD_PREFIX %s | ||
foobar | ||
; A1a-B_c: foobar | ||
|
||
; BAD_PREFIX: Supplied check-prefix is invalid! Prefixes must start with a letter and contain only alphanumeric characters, hyphens and underscores | ||
; BAD_PREFIX: Supplied check-prefix is invalid! Prefixes must be | ||
unique and start with a letter and contain only alphanumeric characters, hyphens and underscores |
Oops, something went wrong.