Add some simple meta-tests for the handling of `filecheck` flags

This commit is contained in:
Zalathar 2024-02-05 13:27:47 +11:00
parent 397937d812
commit 36f298c93d
5 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,4 @@
// Simple test that uses the default CHECK prefix and should always succeed.
// CHECK: main
fn main() {}

View 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() {}

View 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() {}

View File

@ -0,0 +1,5 @@
// A test that doesn't include any filecheck directives should fail.
//@ should-fail
fn main() {}

View 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() {}