Skip to content

Commit

Permalink
Emit error on skip-filecheck test containing filecheck directives
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Oct 19, 2024
1 parent b27f33a commit ebfe0e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/tools/miropt-test-tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ pub fn files_for_miropt_test(

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 }
Expand Down
3 changes: 1 addition & 2 deletions tests/mir-opt/dest-prop/union.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that we can propagate into places that are projections into unions
//@ compile-flags: -Zunsound-mir-opts -C debuginfo=full
Expand All @@ -8,7 +7,7 @@ fn val() -> u32 {

// EMIT_MIR union.main.DestinationPropagation.diff
fn main() {
// CHECK-LABEL: fn args(
// CHECK-LABEL: fn main(
// CHECK: {{_.*}} = Un { us: const 1_u32 };
union Un {
us: u32,
Expand Down
1 change: 0 additions & 1 deletion tests/mir-opt/issues/issue_59352.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// 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
Expand Down

0 comments on commit ebfe0e4

Please sign in to comment.