Add some simple meta-tests for the handling of filecheck flags
This commit is contained in:
parent
397937d812
commit
36f298c93d
5 changed files with 31 additions and 0 deletions
4
tests/codegen/meta-filecheck/check-prefix.rs
Normal file
4
tests/codegen/meta-filecheck/check-prefix.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Simple test that uses the default CHECK prefix and should always succeed.
|
||||
|
||||
// CHECK: main
|
||||
fn main() {}
|
||||
7
tests/codegen/meta-filecheck/msvc-prefix-bad.rs
Normal file
7
tests/codegen/meta-filecheck/msvc-prefix-bad.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// This is exactly like `msvc-prefix-good.rs`, except that it should always fail.
|
||||
|
||||
//@ should-fail
|
||||
|
||||
// MSVC: text that should not match
|
||||
// NONMSVC: text that should not match
|
||||
fn main() {}
|
||||
7
tests/codegen/meta-filecheck/msvc-prefix-good.rs
Normal file
7
tests/codegen/meta-filecheck/msvc-prefix-good.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// One of MSVC or NONMSVC should always be defined, so this test should pass.
|
||||
|
||||
// (one of these should always be present)
|
||||
|
||||
// MSVC: main
|
||||
// NONMSVC: main
|
||||
fn main() {}
|
||||
5
tests/codegen/meta-filecheck/no-directives.rs
Normal file
5
tests/codegen/meta-filecheck/no-directives.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// A test that doesn't include any filecheck directives should fail.
|
||||
|
||||
//@ should-fail
|
||||
|
||||
fn main() {}
|
||||
8
tests/codegen/meta-filecheck/revision-prefix.rs
Normal file
8
tests/codegen/meta-filecheck/revision-prefix.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// The current revision name is registered as a filecheck prefix.
|
||||
|
||||
//@ revisions: GOOD BAD
|
||||
//@ [BAD] should-fail
|
||||
|
||||
// GOOD: main
|
||||
// BAD: text that should not match
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue