Emit error on skip-filecheck test containing filecheck directives

This commit is contained in:
clubby789 2024-10-19 13:20:48 +00:00
parent b27f33a4d9
commit ebfe0e4620
3 changed files with 4 additions and 3 deletions

View File

@ -129,6 +129,9 @@ pub fn files_for_miropt_test(
out.push(MiroptTestFile { expected_file, from_file, to_file }); out.push(MiroptTestFile { expected_file, from_file, to_file });
} }
if !run_filecheck && l.trim_start().starts_with("// CHECK") {
panic!("error: test contains filecheck directive but is marked `skip-filecheck`");
}
} }
MiroptTest { run_filecheck, suffix, files: out, passes } MiroptTest { run_filecheck, suffix, files: out, passes }

View File

@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we can propagate into places that are projections into unions //! Tests that we can propagate into places that are projections into unions
//@ compile-flags: -Zunsound-mir-opts -C debuginfo=full //@ compile-flags: -Zunsound-mir-opts -C debuginfo=full
@ -8,7 +7,7 @@ fn val() -> u32 {
// EMIT_MIR union.main.DestinationPropagation.diff // EMIT_MIR union.main.DestinationPropagation.diff
fn main() { fn main() {
// CHECK-LABEL: fn args( // CHECK-LABEL: fn main(
// CHECK: {{_.*}} = Un { us: const 1_u32 }; // CHECK: {{_.*}} = Un { us: const 1_u32 };
union Un { union Un {
us: u32, us: u32,

View File

@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// This test is a mirror of codegen/issue-59352.rs. // This test is a mirror of codegen/issue-59352.rs.
// The LLVM inliner doesn't inline `char::method::is_digit()` and so it doesn't recognize this case // The LLVM inliner doesn't inline `char::method::is_digit()` and so it doesn't recognize this case