From eb6eed4ba7287aa525273d8b4a385d4d02872504 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 21 Apr 2026 22:30:43 +1000 Subject: [PATCH 1/2] Make `//@ skip-filecheck` a normal compiletest directive --- src/doc/rustc-dev-guide/src/tests/directives.md | 2 ++ src/tools/compiletest/src/directives.rs | 4 ++++ .../compiletest/src/directives/directive_names.rs | 1 + src/tools/compiletest/src/directives/handlers.rs | 14 +++++++++++++- src/tools/compiletest/src/runtest/mir_opt.rs | 4 ++-- src/tools/miropt-test-tools/src/lib.rs | 14 ++++++-------- tests/mir-opt/README.md | 2 +- tests/mir-opt/address_of.rs | 2 +- .../mir-opt/async_closure_fake_read_for_by_move.rs | 2 +- tests/mir-opt/async_closure_shims.rs | 2 +- tests/mir-opt/async_drop_live_dead.rs | 2 +- tests/mir-opt/async_drop_mir_pin.rs | 2 +- tests/mir-opt/box_conditional_drop_allocator.rs | 2 +- tests/mir-opt/build_correct_coerce.rs | 2 +- tests/mir-opt/building/async_await.rs | 2 +- tests/mir-opt/building/coroutine.rs | 2 +- tests/mir-opt/building/custom/aggregate_exprs.rs | 2 +- tests/mir-opt/building/custom/arbitrary_let.rs | 2 +- tests/mir-opt/building/custom/arrays.rs | 2 +- tests/mir-opt/building/custom/as_cast.rs | 2 +- tests/mir-opt/building/custom/assume.rs | 2 +- tests/mir-opt/building/custom/composite_return.rs | 2 +- tests/mir-opt/building/custom/consts.rs | 2 +- tests/mir-opt/building/custom/enums.rs | 2 +- tests/mir-opt/building/custom/operators.rs | 2 +- tests/mir-opt/building/custom/projections.rs | 2 +- tests/mir-opt/building/custom/references.rs | 2 +- tests/mir-opt/building/custom/simple_assign.rs | 2 +- tests/mir-opt/building/custom/terminators.rs | 2 +- tests/mir-opt/building/enum_cast.rs | 2 +- tests/mir-opt/building/eq_never_type.rs | 2 +- tests/mir-opt/building/issue_101867.rs | 2 +- tests/mir-opt/building/issue_110508.rs | 2 +- tests/mir-opt/building/issue_49232.rs | 2 +- .../mir-opt/building/logical_or_in_conditional.rs | 2 +- tests/mir-opt/building/loop_match_diverges.rs | 2 +- .../building/match/deref-patterns/string.rs | 2 +- tests/mir-opt/building/match/exponential_or.rs | 2 +- tests/mir-opt/building/match/match_false_edges.rs | 2 +- tests/mir-opt/building/match/simple_match.rs | 2 +- tests/mir-opt/building/receiver_ptr_mutability.rs | 2 +- tests/mir-opt/building/shifts.rs | 2 +- .../building/storage_live_dead_in_statics.rs | 2 +- tests/mir-opt/building/uniform_array_move_out.rs | 2 +- tests/mir-opt/building/user_type_annotations.rs | 2 +- tests/mir-opt/byte_slice.rs | 2 +- tests/mir-opt/const_allocation.rs | 2 +- tests/mir-opt/const_allocation2.rs | 2 +- tests/mir-opt/const_allocation3.rs | 2 +- tests/mir-opt/const_goto_const_eval_fail.rs | 2 +- tests/mir-opt/const_promotion_extern_static.rs | 2 +- tests/mir-opt/const_prop/invalid_constant.rs | 2 +- tests/mir-opt/const_prop/large_array_index.rs | 2 +- tests/mir-opt/const_prop/offset_of.rs | 2 +- tests/mir-opt/coroutine_drop_cleanup.rs | 2 +- tests/mir-opt/coroutine_storage_dead_unwind.rs | 2 +- tests/mir-opt/coroutine_tiny.rs | 2 +- tests/mir-opt/coverage/branch_match_arms.rs | 2 +- tests/mir-opt/dataflow.rs | 2 +- tests/mir-opt/derefer_complex_case.rs | 2 +- tests/mir-opt/derefer_inline_test.rs | 2 +- tests/mir-opt/derefer_terminator_test.rs | 2 +- tests/mir-opt/derefer_test.rs | 2 +- tests/mir-opt/derefer_test_multiple.rs | 2 +- tests/mir-opt/dest-prop/nrvo_borrowed.rs | 2 +- tests/mir-opt/dont_inline_type_id.rs | 2 +- tests/mir-opt/elaborate_box_deref_in_debuginfo.rs | 2 +- tests/mir-opt/enum_opt.rs | 2 +- tests/mir-opt/fn_ptr_shim.rs | 2 +- tests/mir-opt/funky_arms.rs | 2 +- tests/mir-opt/global_asm.rs | 2 +- tests/mir-opt/graphviz.rs | 2 +- tests/mir-opt/gvn_on_unsafe_binder.rs | 2 +- tests/mir-opt/gvn_ptr_eq_with_constant.rs | 2 +- tests/mir-opt/gvn_uninhabited.rs | 2 +- tests/mir-opt/impossible_predicates.rs | 2 +- tests/mir-opt/inline/inline_async.rs | 2 +- tests/mir-opt/inline/inline_cycle.rs | 2 +- tests/mir-opt/inline/inline_cycle_generic.rs | 2 +- tests/mir-opt/inline/polymorphic_recursion.rs | 2 +- .../recursion_limit_prevents_cycle_discovery.rs | 2 +- tests/mir-opt/inline/type_overflow.rs | 2 +- tests/mir-opt/inline/unit_test.rs | 2 +- tests/mir-opt/inline_coroutine_body.rs | 2 +- tests/mir-opt/inline_default_trait_body.rs | 2 +- tests/mir-opt/inline_double_cycle.rs | 2 +- tests/mir-opt/inline_generically_if_sized.rs | 2 +- tests/mir-opt/issue_101973.rs | 2 +- .../mir-opt/issue_104451_unwindable_intrinsics.rs | 2 +- tests/mir-opt/issue_120925_unsafefncast.rs | 2 +- tests/mir-opt/issue_38669.rs | 2 +- tests/mir-opt/issue_41110.rs | 2 +- tests/mir-opt/issue_41697.rs | 2 +- tests/mir-opt/issue_41888.rs | 2 +- tests/mir-opt/issue_62289.rs | 2 +- tests/mir-opt/issue_72181.rs | 2 +- tests/mir-opt/issue_72181_1.rs | 2 +- tests/mir-opt/issue_76432.rs | 2 +- tests/mir-opt/issue_78192.rs | 2 +- tests/mir-opt/issue_91633.rs | 2 +- tests/mir-opt/issue_99325.rs | 2 +- tests/mir-opt/loop_test.rs | 2 +- tests/mir-opt/match_arm_scopes.rs | 2 +- tests/mir-opt/matches_u8.rs | 2 +- tests/mir-opt/multiple_return_terminators.rs | 2 +- tests/mir-opt/nll/named_lifetimes_basic.rs | 2 +- tests/mir-opt/nll/region_subtyping_basic.rs | 2 +- tests/mir-opt/no_drop_for_inactive_variant.rs | 2 +- tests/mir-opt/no_spurious_drop_after_call.rs | 2 +- tests/mir-opt/or_pattern.rs | 2 +- tests/mir-opt/packed_struct_drop_aligned.rs | 2 +- tests/mir-opt/pre-codegen/chained_comparison.rs | 2 +- .../pre-codegen/duplicate_switch_targets.rs | 2 +- tests/mir-opt/pre-codegen/intrinsics.rs | 2 +- tests/mir-opt/pre-codegen/loops.rs | 2 +- tests/mir-opt/pre-codegen/mem_replace.rs | 2 +- .../mir-opt/pre-codegen/optimizes_into_variable.rs | 2 +- tests/mir-opt/pre-codegen/ptr_offset.rs | 2 +- tests/mir-opt/pre-codegen/range_iter.rs | 2 +- tests/mir-opt/pre-codegen/slice_filter.rs | 2 +- tests/mir-opt/pre-codegen/slice_iter.rs | 2 +- tests/mir-opt/pre-codegen/spans.rs | 2 +- tests/mir-opt/pre-codegen/try_identity.rs | 2 +- tests/mir-opt/pre-codegen/vec_deref.rs | 2 +- tests/mir-opt/remove_fake_borrows.rs | 2 +- tests/mir-opt/remove_never_const.rs | 2 +- tests/mir-opt/retag.rs | 2 +- tests/mir-opt/return_an_array.rs | 2 +- tests/mir-opt/separate_const_switch.rs | 2 +- tests/mir-opt/simplify_cfg.rs | 2 +- tests/mir-opt/simplify_locals.rs | 2 +- .../simplify_locals_removes_unused_consts.rs | 2 +- ...ify_locals_removes_unused_discriminant_reads.rs | 2 +- tests/mir-opt/slice_drop_shim.rs | 2 +- tests/mir-opt/ssa_unreachable_116212.rs | 2 +- tests/mir-opt/storage_ranges.rs | 2 +- tests/mir-opt/switch_to_self.rs | 2 +- tests/mir-opt/tail_call_drops.rs | 2 +- tests/mir-opt/tail_expr_drop_order_unwind.rs | 2 +- tests/mir-opt/tls_access.rs | 2 +- tests/mir-opt/uninhabited_enum.rs | 2 +- .../mir-opt/uninhabited_fallthrough_elimination.rs | 2 +- tests/mir-opt/uninhabited_not_read.rs | 2 +- tests/mir-opt/unusual_item_types.rs | 2 +- 144 files changed, 166 insertions(+), 149 deletions(-) diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index 76bf2cdbea667..506deb1942db2 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -326,6 +326,8 @@ See [Pretty-printer](compiletest.md#pretty-printer-tests). The following directives affect how certain command-line tools are invoked, in test suites that use those tools: +- `skip-filecheck` avoids running LLVM's `FileCheck` tool in tests that would normally run it to check output. + - Used by mir-opt tests. - `filecheck-flags` adds extra flags when running LLVM's `FileCheck` tool. - Used by [codegen tests](compiletest.md#codegen-tests), [assembly tests](compiletest.md#assembly-tests), and diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs index 44765c906c991..fd5c9d02b6d71 100644 --- a/src/tools/compiletest/src/directives.rs +++ b/src/tools/compiletest/src/directives.rs @@ -195,6 +195,9 @@ pub(crate) struct TestProps { /// Extra flags to pass to `llvm-cov` when producing coverage reports. /// Only used by the "coverage-run" test mode. pub(crate) llvm_cov_flags: Vec, + /// Don't run LLVM's `filecheck` tool to check compiler output, + /// in tests that would normally run it. + pub(crate) skip_filecheck: bool, /// Extra flags to pass to LLVM's `filecheck` tool, in tests that use it. pub(crate) filecheck_flags: Vec, /// Don't automatically insert any `--check-cfg` args @@ -308,6 +311,7 @@ impl TestProps { mir_unit_test: None, remap_src_base: false, llvm_cov_flags: vec![], + skip_filecheck: false, filecheck_flags: vec![], no_auto_check_cfg: false, add_minicore: false, diff --git a/src/tools/compiletest/src/directives/directive_names.rs b/src/tools/compiletest/src/directives/directive_names.rs index 34c6c1374b632..0d06f6e75af7c 100644 --- a/src/tools/compiletest/src/directives/directive_names.rs +++ b/src/tools/compiletest/src/directives/directive_names.rs @@ -286,6 +286,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "rustc-env", "rustfix-only-machine-applicable", "should-fail", + "skip-filecheck", "stderr-per-bitwidth", "test-mir-pass", "unique-doc-out-dir", diff --git a/src/tools/compiletest/src/directives/handlers.rs b/src/tools/compiletest/src/directives/handlers.rs index 5e6d2d49d7dcf..1f2d9709ee9db 100644 --- a/src/tools/compiletest/src/directives/handlers.rs +++ b/src/tools/compiletest/src/directives/handlers.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use std::sync::{Arc, LazyLock}; -use crate::common::Config; +use crate::common::{Config, TestMode}; use crate::directives::{ DirectiveLine, NormalizeKind, NormalizeRule, TestProps, parse_and_update_aux, parse_edition_range, split_flags, @@ -312,6 +312,18 @@ fn make_directive_handlers_map() -> HashMap<&'static str, Handler> { props.llvm_cov_flags.extend(split_flags(&flags)); } }), + handler("skip-filecheck", |config, ln, props| { + let directive_name = ln.name; + // FIXME(Zalathar): Someday we should add unified support for declaring + // and checking which modes are supported by each directive. + if !matches!(config.mode, TestMode::MirOpt) { + panic!( + "directive `//@ {directive_name}` is not supported by this test suite (mode: {mode:?})", + mode = config.mode + ); + } + config.set_name_directive(ln, directive_name, &mut props.skip_filecheck); + }), handler(FILECHECK_FLAGS, |config, ln, props| { if let Some(flags) = config.parse_name_value_directive(ln, FILECHECK_FLAGS) { props.filecheck_flags.extend(split_flags(&flags)); diff --git a/src/tools/compiletest/src/runtest/mir_opt.rs b/src/tools/compiletest/src/runtest/mir_opt.rs index 9448792638346..f2e06958bc6fb 100644 --- a/src/tools/compiletest/src/runtest/mir_opt.rs +++ b/src/tools/compiletest/src/runtest/mir_opt.rs @@ -40,7 +40,7 @@ impl TestCx<'_> { let test_dir = self.testpaths.file.parent().unwrap(); let test_crate = self.testpaths.file.file_stem().unwrap().replace('-', "_"); - let MiroptTest { run_filecheck, suffix, files, passes: _ } = test_info; + let MiroptTest { suffix, files, passes: _ } = test_info; if self.config.bless { for e in glob(&format!("{}/{}.*{}.mir", test_dir, test_crate, suffix)).unwrap() { @@ -89,7 +89,7 @@ impl TestCx<'_> { } } - if run_filecheck { + if !self.props.skip_filecheck { let output_path = self.output_base_name().with_extension("mir"); let proc_res = self.verify_with_filecheck(&output_path); if !proc_res.status.success() { diff --git a/src/tools/miropt-test-tools/src/lib.rs b/src/tools/miropt-test-tools/src/lib.rs index 10769c9c8abfe..df1645cbf14d5 100644 --- a/src/tools/miropt-test-tools/src/lib.rs +++ b/src/tools/miropt-test-tools/src/lib.rs @@ -8,7 +8,6 @@ pub struct MiroptTestFile { } pub struct MiroptTest { - pub run_filecheck: bool, pub suffix: String, pub files: Vec, /// Vec of passes under test to be dumped @@ -57,13 +56,15 @@ pub fn files_for_miropt_test( let test_crate = testfile.file_stem().unwrap().to_str().unwrap().replace('-', "_"); let suffix = output_file_suffix(testfile, bit_width, panic_strategy); - let mut run_filecheck = true; let mut passes = Vec::new(); for l in test_file_contents.lines() { + // FIXME(Zalathar): Remove this `skip-filecheck` migration error in 2027, + // or perhaps earlier if it seems no longer useful. if l.starts_with("// skip-filecheck") { - run_filecheck = false; - continue; + panic!( + "error: `// skip-filecheck` is no longer supported, use `//@ skip-filecheck` instead." + ); } if l.starts_with("// EMIT_MIR ") { let test_name = l.trim_start_matches("// EMIT_MIR ").trim(); @@ -128,10 +129,7 @@ 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 } + MiroptTest { suffix, files: out, passes } } diff --git a/tests/mir-opt/README.md b/tests/mir-opt/README.md index e4b252f5565b0..69705dbf2b8a4 100644 --- a/tests/mir-opt/README.md +++ b/tests/mir-opt/README.md @@ -57,7 +57,7 @@ The LLVM FileCheck tool is used to verify the contents of output MIR against `CH present in the test file. This works on the runtime MIR, generated by `--emit=mir`, and not on the output of a individual passes. -Use `// skip-filecheck` to prevent FileCheck from running. +Use `//@ skip-filecheck` to prevent FileCheck from running. To check MIR for function `foo`, start with a `// CHECK-LABEL fn foo(` directive. diff --git a/tests/mir-opt/address_of.rs b/tests/mir-opt/address_of.rs index 164ab38ebe754..0e97bc8c6fe6d 100644 --- a/tests/mir-opt/address_of.rs +++ b/tests/mir-opt/address_of.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR address_of.address_of_reborrow.SimplifyCfg-initial.after.mir fn address_of_reborrow() { diff --git a/tests/mir-opt/async_closure_fake_read_for_by_move.rs b/tests/mir-opt/async_closure_fake_read_for_by_move.rs index e78671f5e9d56..08a4c8a4edcb1 100644 --- a/tests/mir-opt/async_closure_fake_read_for_by_move.rs +++ b/tests/mir-opt/async_closure_fake_read_for_by_move.rs @@ -1,5 +1,5 @@ //@ edition:2021 -// skip-filecheck +//@ skip-filecheck enum Foo { Bar, diff --git a/tests/mir-opt/async_closure_shims.rs b/tests/mir-opt/async_closure_shims.rs index 93cc7834a643f..7bf937164d5df 100644 --- a/tests/mir-opt/async_closure_shims.rs +++ b/tests/mir-opt/async_closure_shims.rs @@ -1,5 +1,5 @@ //@ edition:2021 -// skip-filecheck +//@ skip-filecheck #![allow(unused)] diff --git a/tests/mir-opt/async_drop_live_dead.rs b/tests/mir-opt/async_drop_live_dead.rs index 348866bbb8c75..12b9d527dfad4 100644 --- a/tests/mir-opt/async_drop_live_dead.rs +++ b/tests/mir-opt/async_drop_live_dead.rs @@ -1,5 +1,5 @@ //@ edition:2024 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![feature(async_drop)] diff --git a/tests/mir-opt/async_drop_mir_pin.rs b/tests/mir-opt/async_drop_mir_pin.rs index 35626f13f8945..47f69b611a358 100644 --- a/tests/mir-opt/async_drop_mir_pin.rs +++ b/tests/mir-opt/async_drop_mir_pin.rs @@ -1,6 +1,6 @@ //@edition: 2024 //@ test-mir-pass: MentionedItems -// skip-filecheck +//@ skip-filecheck #![feature(async_drop)] #![allow(incomplete_features)] use std::future::AsyncDrop; diff --git a/tests/mir-opt/box_conditional_drop_allocator.rs b/tests/mir-opt/box_conditional_drop_allocator.rs index 9471be14c8770..741c396b0c2d7 100644 --- a/tests/mir-opt/box_conditional_drop_allocator.rs +++ b/tests/mir-opt/box_conditional_drop_allocator.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: ElaborateDrops //@ needs-unwind #![feature(allocator_api)] diff --git a/tests/mir-opt/build_correct_coerce.rs b/tests/mir-opt/build_correct_coerce.rs index b6c861636dcaa..004e1309b0b26 100644 --- a/tests/mir-opt/build_correct_coerce.rs +++ b/tests/mir-opt/build_correct_coerce.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Validate that we record the target for the `as` coercion as `for<'a> fn(&'a (), &'a ())`, // and not `for<'a, 'b>(&'a (), &'b ())`. We previously did the latter due to a bug in diff --git a/tests/mir-opt/building/async_await.rs b/tests/mir-opt/building/async_await.rs index 2d14a1fb0c6f7..e84f8a6c561bc 100644 --- a/tests/mir-opt/building/async_await.rs +++ b/tests/mir-opt/building/async_await.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // This test makes sure that the coroutine MIR pass eliminates all calls to // `get_context`, and that the MIR argument type for an async fn and all locals // related to `yield` are `&mut Context`, and its return type is `Poll`. diff --git a/tests/mir-opt/building/coroutine.rs b/tests/mir-opt/building/coroutine.rs index 6d50c4d90b1a4..77388c8786aaa 100644 --- a/tests/mir-opt/building/coroutine.rs +++ b/tests/mir-opt/building/coroutine.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ edition:2024 //@ compile-flags: -Zmir-opt-level=0 -C panic=abort diff --git a/tests/mir-opt/building/custom/aggregate_exprs.rs b/tests/mir-opt/building/custom/aggregate_exprs.rs index 8985f106817b0..ec81e9a7f21ca 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.rs +++ b/tests/mir-opt/building/custom/aggregate_exprs.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/arbitrary_let.rs b/tests/mir-opt/building/custom/arbitrary_let.rs index 3f251cd81bce4..5075fb234d490 100644 --- a/tests/mir-opt/building/custom/arbitrary_let.rs +++ b/tests/mir-opt/building/custom/arbitrary_let.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/arrays.rs b/tests/mir-opt/building/custom/arrays.rs index e9cdded4a0e68..2022292d3e41f 100644 --- a/tests/mir-opt/building/custom/arrays.rs +++ b/tests/mir-opt/building/custom/arrays.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/as_cast.rs b/tests/mir-opt/building/custom/as_cast.rs index 908d378771d5a..e8e7fb265df84 100644 --- a/tests/mir-opt/building/custom/as_cast.rs +++ b/tests/mir-opt/building/custom/as_cast.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/assume.rs b/tests/mir-opt/building/custom/assume.rs index 4a55617136a10..cbbebee820d31 100644 --- a/tests/mir-opt/building/custom/assume.rs +++ b/tests/mir-opt/building/custom/assume.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/composite_return.rs b/tests/mir-opt/building/custom/composite_return.rs index 0cf2cc8d18908..4e85e9a33d740 100644 --- a/tests/mir-opt/building/custom/composite_return.rs +++ b/tests/mir-opt/building/custom/composite_return.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/consts.rs b/tests/mir-opt/building/custom/consts.rs index c64709082dc31..4f1a55a81dfaa 100644 --- a/tests/mir-opt/building/custom/consts.rs +++ b/tests/mir-opt/building/custom/consts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/enums.rs b/tests/mir-opt/building/custom/enums.rs index 6fad373203a69..ec2922922d73d 100644 --- a/tests/mir-opt/building/custom/enums.rs +++ b/tests/mir-opt/building/custom/enums.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/operators.rs b/tests/mir-opt/building/custom/operators.rs index 07abf2d965172..7e9ff6c6d5a55 100644 --- a/tests/mir-opt/building/custom/operators.rs +++ b/tests/mir-opt/building/custom/operators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: --crate-type=lib #![feature(custom_mir, core_intrinsics)] use std::intrinsics::mir::*; diff --git a/tests/mir-opt/building/custom/projections.rs b/tests/mir-opt/building/custom/projections.rs index e59eebd9952d7..97d38ecf033b1 100644 --- a/tests/mir-opt/building/custom/projections.rs +++ b/tests/mir-opt/building/custom/projections.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/references.rs b/tests/mir-opt/building/custom/references.rs index 7ea8f8b4c156d..18169792bd8fe 100644 --- a/tests/mir-opt/building/custom/references.rs +++ b/tests/mir-opt/building/custom/references.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/simple_assign.rs b/tests/mir-opt/building/custom/simple_assign.rs index d6d054ab5a389..949d8fbee9c0f 100644 --- a/tests/mir-opt/building/custom/simple_assign.rs +++ b/tests/mir-opt/building/custom/simple_assign.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs index ed08040a2a58c..1bd796c248f82 100644 --- a/tests/mir-opt/building/custom/terminators.rs +++ b/tests/mir-opt/building/custom/terminators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/enum_cast.rs b/tests/mir-opt/building/enum_cast.rs index 07025f572ab20..5beae823bcc77 100644 --- a/tests/mir-opt/building/enum_cast.rs +++ b/tests/mir-opt/building/enum_cast.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR enum_cast.foo.built.after.mir // EMIT_MIR enum_cast.bar.built.after.mir // EMIT_MIR enum_cast.boo.built.after.mir diff --git a/tests/mir-opt/building/eq_never_type.rs b/tests/mir-opt/building/eq_never_type.rs index 486e2f9fb8dfa..762f20ee1e104 100644 --- a/tests/mir-opt/building/eq_never_type.rs +++ b/tests/mir-opt/building/eq_never_type.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck #![feature(never_type)] #![allow(unreachable_code)] diff --git a/tests/mir-opt/building/issue_101867.rs b/tests/mir-opt/building/issue_101867.rs index a00bc13b3fe5f..91f078ccb1190 100644 --- a/tests/mir-opt/building/issue_101867.rs +++ b/tests/mir-opt/building/issue_101867.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR issue_101867.main.built.after.mir fn main() { let x: Option = Some(1); diff --git a/tests/mir-opt/building/issue_110508.rs b/tests/mir-opt/building/issue_110508.rs index aa8a7b1d08f4a..5f94f2658bf7e 100644 --- a/tests/mir-opt/building/issue_110508.rs +++ b/tests/mir-opt/building/issue_110508.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR issue_110508.{impl#0}-BAR.built.after.mir // EMIT_MIR issue_110508.{impl#0}-SELF_BAR.built.after.mir diff --git a/tests/mir-opt/building/issue_49232.rs b/tests/mir-opt/building/issue_49232.rs index f17e3e955a41c..6772d5aea0b88 100644 --- a/tests/mir-opt/building/issue_49232.rs +++ b/tests/mir-opt/building/issue_49232.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // We must mark a variable whose initialization fails due to an // abort statement as StorageDead. diff --git a/tests/mir-opt/building/logical_or_in_conditional.rs b/tests/mir-opt/building/logical_or_in_conditional.rs index d1c1ea2896aaf..0abf2b24ddaa2 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.rs +++ b/tests/mir-opt/building/logical_or_in_conditional.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -Z validate-mir //@ edition: 2024 struct Droppy(u8); diff --git a/tests/mir-opt/building/loop_match_diverges.rs b/tests/mir-opt/building/loop_match_diverges.rs index 774e195c33c96..bef91c42472c0 100644 --- a/tests/mir-opt/building/loop_match_diverges.rs +++ b/tests/mir-opt/building/loop_match_diverges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![allow(incomplete_features)] #![feature(loop_match)] #![crate_type = "lib"] diff --git a/tests/mir-opt/building/match/deref-patterns/string.rs b/tests/mir-opt/building/match/deref-patterns/string.rs index 92232c7df79dc..2426cb7d1a759 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.rs +++ b/tests/mir-opt/building/match/deref-patterns/string.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 -C panic=abort #![feature(deref_patterns)] diff --git a/tests/mir-opt/building/match/exponential_or.rs b/tests/mir-opt/building/match/exponential_or.rs index 89963b9bdf444..e6ed7107b8b33 100644 --- a/tests/mir-opt/building/match/exponential_or.rs +++ b/tests/mir-opt/building/match/exponential_or.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that simple or-patterns don't get expanded to exponentially large CFGs // EMIT_MIR exponential_or.match_tuple.SimplifyCfg-initial.after.mir diff --git a/tests/mir-opt/building/match/match_false_edges.rs b/tests/mir-opt/building/match/match_false_edges.rs index 839eda40c8540..d58d9d406b88f 100644 --- a/tests/mir-opt/building/match/match_false_edges.rs +++ b/tests/mir-opt/building/match/match_false_edges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck fn guard() -> bool { false } diff --git a/tests/mir-opt/building/match/simple_match.rs b/tests/mir-opt/building/match/simple_match.rs index c8b3d90748afb..ca084093f9027 100644 --- a/tests/mir-opt/building/match/simple_match.rs +++ b/tests/mir-opt/building/match/simple_match.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that we don't generate unnecessarily large MIR for very simple matches // EMIT_MIR simple_match.match_bool.built.after.mir diff --git a/tests/mir-opt/building/receiver_ptr_mutability.rs b/tests/mir-opt/building/receiver_ptr_mutability.rs index 37b142f1d8ad2..d9adcc74b02e9 100644 --- a/tests/mir-opt/building/receiver_ptr_mutability.rs +++ b/tests/mir-opt/building/receiver_ptr_mutability.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR receiver_ptr_mutability.main.built.after.mir #![feature(arbitrary_self_types_pointers)] diff --git a/tests/mir-opt/building/shifts.rs b/tests/mir-opt/building/shifts.rs index 165b388bc18b5..947e2394cfaa6 100644 --- a/tests/mir-opt/building/shifts.rs +++ b/tests/mir-opt/building/shifts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -C debug-assertions=yes // EMIT_MIR shifts.shift_signed.built.after.mir diff --git a/tests/mir-opt/building/storage_live_dead_in_statics.rs b/tests/mir-opt/building/storage_live_dead_in_statics.rs index 868f4a8f55974..1d78c4f188c5c 100644 --- a/tests/mir-opt/building/storage_live_dead_in_statics.rs +++ b/tests/mir-opt/building/storage_live_dead_in_statics.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // Check that when we compile the static `XXX` into MIR, we do not // generate `StorageStart` or `StorageEnd` statements. diff --git a/tests/mir-opt/building/uniform_array_move_out.rs b/tests/mir-opt/building/uniform_array_move_out.rs index 573e64f26dcb6..58a3aa2275fd8 100644 --- a/tests/mir-opt/building/uniform_array_move_out.rs +++ b/tests/mir-opt/building/uniform_array_move_out.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // Can't emit `built.after` here as that contains user type annotations which contain DefId that // change all the time. diff --git a/tests/mir-opt/building/user_type_annotations.rs b/tests/mir-opt/building/user_type_annotations.rs index 527bf62f7dc05..ecfb55be51afd 100644 --- a/tests/mir-opt/building/user_type_annotations.rs +++ b/tests/mir-opt/building/user_type_annotations.rs @@ -1,6 +1,6 @@ //@ compile-flags: -Zmir-opt-level=0 //@ edition: 2024 -// skip-filecheck +//@ skip-filecheck // This test demonstrates how many user type annotations are recorded in MIR // for various binding constructs. In particular, this makes it possible to see diff --git a/tests/mir-opt/byte_slice.rs b/tests/mir-opt/byte_slice.rs index fa616b62ad0b2..cd37c3090c7cf 100644 --- a/tests/mir-opt/byte_slice.rs +++ b/tests/mir-opt/byte_slice.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 // EMIT_MIR byte_slice.main.SimplifyCfg-pre-optimizations.after.mir diff --git a/tests/mir-opt/const_allocation.rs b/tests/mir-opt/const_allocation.rs index e65b2ed9a879c..c4f2986a8fb92 100644 --- a/tests/mir-opt/const_allocation.rs +++ b/tests/mir-opt/const_allocation.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_allocation2.rs b/tests/mir-opt/const_allocation2.rs index 0681d4356dd8e..f86462ff3805b 100644 --- a/tests/mir-opt/const_allocation2.rs +++ b/tests/mir-opt/const_allocation2.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_allocation3.rs b/tests/mir-opt/const_allocation3.rs index 9d2006b6fe80d..2f1cbbf7b330a 100644 --- a/tests/mir-opt/const_allocation3.rs +++ b/tests/mir-opt/const_allocation3.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_goto_const_eval_fail.rs b/tests/mir-opt/const_goto_const_eval_fail.rs index fa0f5f6145908..df23c6e5030ca 100644 --- a/tests/mir-opt/const_goto_const_eval_fail.rs +++ b/tests/mir-opt/const_goto_const_eval_fail.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(min_const_generics)] #![crate_type = "lib"] diff --git a/tests/mir-opt/const_promotion_extern_static.rs b/tests/mir-opt/const_promotion_extern_static.rs index fe258f5e8fdb3..f16a53270a97d 100644 --- a/tests/mir-opt/const_promotion_extern_static.rs +++ b/tests/mir-opt/const_promotion_extern_static.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ ignore-endian-big extern "C" { static X: i32; diff --git a/tests/mir-opt/const_prop/invalid_constant.rs b/tests/mir-opt/const_prop/invalid_constant.rs index 901c3721d9238..f0e1f30a82fe7 100644 --- a/tests/mir-opt/const_prop/invalid_constant.rs +++ b/tests/mir-opt/const_prop/invalid_constant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ compile-flags: -Zmir-enable-passes=+RemoveZsts -Zdump-mir-exclude-alloc-bytes // Verify that we can pretty print invalid constants. diff --git a/tests/mir-opt/const_prop/large_array_index.rs b/tests/mir-opt/const_prop/large_array_index.rs index afba73f6a17f7..b22a0e4015869 100644 --- a/tests/mir-opt/const_prop/large_array_index.rs +++ b/tests/mir-opt/const_prop/large_array_index.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_prop/offset_of.rs b/tests/mir-opt/const_prop/offset_of.rs index c2f5e83d6868f..ae0d54939186a 100644 --- a/tests/mir-opt/const_prop/offset_of.rs +++ b/tests/mir-opt/const_prop/offset_of.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/coroutine_drop_cleanup.rs b/tests/mir-opt/coroutine_drop_cleanup.rs index 4ae97273cd90a..f73fa6ea64f51 100644 --- a/tests/mir-opt/coroutine_drop_cleanup.rs +++ b/tests/mir-opt/coroutine_drop_cleanup.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/coroutine_storage_dead_unwind.rs b/tests/mir-opt/coroutine_storage_dead_unwind.rs index ce9bad483af83..0537aedcf230b 100644 --- a/tests/mir-opt/coroutine_storage_dead_unwind.rs +++ b/tests/mir-opt/coroutine_storage_dead_unwind.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that we generate StorageDead on unwind paths for coroutines. diff --git a/tests/mir-opt/coroutine_tiny.rs b/tests/mir-opt/coroutine_tiny.rs index 81e9940541ba0..b92628aebf96a 100644 --- a/tests/mir-opt/coroutine_tiny.rs +++ b/tests/mir-opt/coroutine_tiny.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //! Tests that coroutines that cannot return or unwind don't have unnecessary //! panic branches. diff --git a/tests/mir-opt/coverage/branch_match_arms.rs b/tests/mir-opt/coverage/branch_match_arms.rs index 18764b38d6e3e..10e0b27aeec86 100644 --- a/tests/mir-opt/coverage/branch_match_arms.rs +++ b/tests/mir-opt/coverage/branch_match_arms.rs @@ -1,7 +1,7 @@ #![feature(coverage_attribute)] //@ test-mir-pass: InstrumentCoverage //@ compile-flags: -Cinstrument-coverage -Zno-profiler-runtime -Zcoverage-options=branch -// skip-filecheck +//@ skip-filecheck enum Enum { A(u32), diff --git a/tests/mir-opt/dataflow.rs b/tests/mir-opt/dataflow.rs index 5ed3da4c531a8..01981dfbec8b0 100644 --- a/tests/mir-opt/dataflow.rs +++ b/tests/mir-opt/dataflow.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test graphviz dataflow output //@ compile-flags: -Z dump-mir=main -Z dump-mir-dataflow diff --git a/tests/mir-opt/derefer_complex_case.rs b/tests/mir-opt/derefer_complex_case.rs index 96034522b9fe0..87968618b7a5f 100644 --- a/tests/mir-opt/derefer_complex_case.rs +++ b/tests/mir-opt/derefer_complex_case.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_complex_case.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_inline_test.rs b/tests/mir-opt/derefer_inline_test.rs index 7f9272bdec852..26ff026a96fc2 100644 --- a/tests/mir-opt/derefer_inline_test.rs +++ b/tests/mir-opt/derefer_inline_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_inline_test.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_terminator_test.rs b/tests/mir-opt/derefer_terminator_test.rs index fd16c6c2045ed..ebc8bb9ae94d5 100644 --- a/tests/mir-opt/derefer_terminator_test.rs +++ b/tests/mir-opt/derefer_terminator_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_terminator_test.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_test.rs b/tests/mir-opt/derefer_test.rs index 5676fa657fe91..078c6c1ba0438 100644 --- a/tests/mir-opt/derefer_test.rs +++ b/tests/mir-opt/derefer_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_test.main.Derefer.diff fn main() { diff --git a/tests/mir-opt/derefer_test_multiple.rs b/tests/mir-opt/derefer_test_multiple.rs index 7c03af00e1e6b..d2b33edbe484b 100644 --- a/tests/mir-opt/derefer_test_multiple.rs +++ b/tests/mir-opt/derefer_test_multiple.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_test_multiple.main.Derefer.diff fn main() { diff --git a/tests/mir-opt/dest-prop/nrvo_borrowed.rs b/tests/mir-opt/dest-prop/nrvo_borrowed.rs index 6f3076d4c13e9..b2a01abb12b43 100644 --- a/tests/mir-opt/dest-prop/nrvo_borrowed.rs +++ b/tests/mir-opt/dest-prop/nrvo_borrowed.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ test-mir-pass: DestinationPropagation diff --git a/tests/mir-opt/dont_inline_type_id.rs b/tests/mir-opt/dont_inline_type_id.rs index d389733457b8c..e23df9ac3dfda 100644 --- a/tests/mir-opt/dont_inline_type_id.rs +++ b/tests/mir-opt/dont_inline_type_id.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ compile-flags: --crate-type=lib -C panic=abort diff --git a/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs index 0046e7104f1c6..3897f58df0415 100644 --- a/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs +++ b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: ElaborateBoxDerefs #![feature(custom_mir, core_intrinsics)] diff --git a/tests/mir-opt/enum_opt.rs b/tests/mir-opt/enum_opt.rs index 45a3edca90ed3..90697a71cdfc1 100644 --- a/tests/mir-opt/enum_opt.rs +++ b/tests/mir-opt/enum_opt.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: EnumSizeOpt // EMIT_MIR_FOR_EACH_BIT_WIDTH //@ compile-flags: -Zunsound-mir-opts diff --git a/tests/mir-opt/fn_ptr_shim.rs b/tests/mir-opt/fn_ptr_shim.rs index 326188efe019a..0f46f2fc2004f 100644 --- a/tests/mir-opt/fn_ptr_shim.rs +++ b/tests/mir-opt/fn_ptr_shim.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 // Tests that the `` shim does not create a `Call` terminator with a `Self` callee diff --git a/tests/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs index 8018f26997e46..6edfe27162f96 100644 --- a/tests/mir-opt/funky_arms.rs +++ b/tests/mir-opt/funky_arms.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/global_asm.rs b/tests/mir-opt/global_asm.rs index 22b782d365e94..f6b705a225f2a 100644 --- a/tests/mir-opt/global_asm.rs +++ b/tests/mir-opt/global_asm.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ needs-asm-support // `global_asm!` gets a fake body, make sure it is handled correctly diff --git a/tests/mir-opt/graphviz.rs b/tests/mir-opt/graphviz.rs index f5e8fd77d854c..2537dcab0d3a8 100644 --- a/tests/mir-opt/graphviz.rs +++ b/tests/mir-opt/graphviz.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test graphviz output //@ compile-flags: -Z dump-mir-graphviz diff --git a/tests/mir-opt/gvn_on_unsafe_binder.rs b/tests/mir-opt/gvn_on_unsafe_binder.rs index b3c0576f99067..81289c50c9957 100644 --- a/tests/mir-opt/gvn_on_unsafe_binder.rs +++ b/tests/mir-opt/gvn_on_unsafe_binder.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR gvn_on_unsafe_binder.test.GVN.diff diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.rs b/tests/mir-opt/gvn_ptr_eq_with_constant.rs index 05445208e070f..31ccec4c583dc 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.rs +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ only-64bit //@ compile-flags: -Z mir-enable-passes=+Inline diff --git a/tests/mir-opt/gvn_uninhabited.rs b/tests/mir-opt/gvn_uninhabited.rs index 015949c5d20b9..78afc0efef900 100644 --- a/tests/mir-opt/gvn_uninhabited.rs +++ b/tests/mir-opt/gvn_uninhabited.rs @@ -1,7 +1,7 @@ //@ test-mir-pass: GVN //@ compile-flags: -O // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck #![feature(never_type)] diff --git a/tests/mir-opt/impossible_predicates.rs b/tests/mir-opt/impossible_predicates.rs index 34adf7f916144..3858bb657635d 100644 --- a/tests/mir-opt/impossible_predicates.rs +++ b/tests/mir-opt/impossible_predicates.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR impossible_predicates.impossible_predicate.ImpossiblePredicates.diff pub fn impossible_predicate(x: &mut i32) -> (&mut i32, &mut i32) diff --git a/tests/mir-opt/inline/inline_async.rs b/tests/mir-opt/inline/inline_async.rs index c5684f51cce5d..49ba0f415edef 100644 --- a/tests/mir-opt/inline/inline_async.rs +++ b/tests/mir-opt/inline/inline_async.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Checks that inliner doesn't introduce cycles when optimizing coroutines. // The outcome of optimization is not verfied, just the absence of the cycle. // Regression test for #76181. diff --git a/tests/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs index 651112ccfd7f2..9af70c416b3a9 100644 --- a/tests/mir-opt/inline/inline_cycle.rs +++ b/tests/mir-opt/inline/inline_cycle.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -C debuginfo=full // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that inliner handles various forms of recursion and doesn't fall into diff --git a/tests/mir-opt/inline/inline_cycle_generic.rs b/tests/mir-opt/inline/inline_cycle_generic.rs index 64f208b1c70b5..fd2f54c901d6a 100644 --- a/tests/mir-opt/inline/inline_cycle_generic.rs +++ b/tests/mir-opt/inline/inline_cycle_generic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that inliner handles various forms of recursion and doesn't fall into // an infinite inlining cycle. The particular outcome of inlining is not diff --git a/tests/mir-opt/inline/polymorphic_recursion.rs b/tests/mir-opt/inline/polymorphic_recursion.rs index 0338d604635e7..e5a395822c6d1 100644 --- a/tests/mir-opt/inline/polymorphic_recursion.rs +++ b/tests/mir-opt/inline/polymorphic_recursion.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Make sure that the MIR inliner does not loop indefinitely on polymorphic recursion. //@ compile-flags: --crate-type lib diff --git a/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs index 866d6fbd9e971..8a126d04d5e68 100644 --- a/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs +++ b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs @@ -1,6 +1,6 @@ //@ aux-build: wrapper.rs //@ compile-flags: -Zmir-opt-level=2 -Zinline-mir -// skip-filecheck +//@ skip-filecheck // This is a regression test for https://github.com/rust-lang/rust/issues/146998 diff --git a/tests/mir-opt/inline/type_overflow.rs b/tests/mir-opt/inline/type_overflow.rs index bfd9e71b9e73f..546514a6c1aad 100644 --- a/tests/mir-opt/inline/type_overflow.rs +++ b/tests/mir-opt/inline/type_overflow.rs @@ -1,7 +1,7 @@ // This is a regression test for one of the problems in #128887; it checks that the // strategy in #129714 avoids trait solver overflows in this specific case. -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zinline-mir pub trait Foo { diff --git a/tests/mir-opt/inline/unit_test.rs b/tests/mir-opt/inline/unit_test.rs index bebe69384612e..562b8e4117115 100644 --- a/tests/mir-opt/inline/unit_test.rs +++ b/tests/mir-opt/inline/unit_test.rs @@ -1,6 +1,6 @@ // Check that `-Zmir-enable-passes=+Inline` does not ICE because of stolen MIR. //@ test-mir-pass: Inline -// skip-filecheck +//@ skip-filecheck #![crate_type = "lib"] // Randomize `def_path_hash` by defining them under a module with different names diff --git a/tests/mir-opt/inline_coroutine_body.rs b/tests/mir-opt/inline_coroutine_body.rs index 4326ff8a11b39..c97738baa882b 100644 --- a/tests/mir-opt/inline_coroutine_body.rs +++ b/tests/mir-opt/inline_coroutine_body.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir-hint-threshold=10000 -Zinline-mir-threshold=10000 --crate-type=lib diff --git a/tests/mir-opt/inline_default_trait_body.rs b/tests/mir-opt/inline_default_trait_body.rs index aeb8031b41866..cad0e4d203285 100644 --- a/tests/mir-opt/inline_default_trait_body.rs +++ b/tests/mir-opt/inline_default_trait_body.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir --crate-type=lib diff --git a/tests/mir-opt/inline_double_cycle.rs b/tests/mir-opt/inline_double_cycle.rs index cf3b87cf0ad30..e76977586f78e 100644 --- a/tests/mir-opt/inline_double_cycle.rs +++ b/tests/mir-opt/inline_double_cycle.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir --crate-type=lib diff --git a/tests/mir-opt/inline_generically_if_sized.rs b/tests/mir-opt/inline_generically_if_sized.rs index e4fc94ec43626..ecd0440e7332e 100644 --- a/tests/mir-opt/inline_generically_if_sized.rs +++ b/tests/mir-opt/inline_generically_if_sized.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ compile-flags: --crate-type=lib -C panic=abort diff --git a/tests/mir-opt/issue_101973.rs b/tests/mir-opt/issue_101973.rs index 84a36f1374e8e..66f594028fa7e 100644 --- a/tests/mir-opt/issue_101973.rs +++ b/tests/mir-opt/issue_101973.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ compile-flags: -O -C debug-assertions=on // This needs inlining followed by GVN to reproduce, so we cannot use "test-mir-pass". diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs index 80655a583c348..a449c4592e84b 100644 --- a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs +++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Check that `UnwindAction::Unreachable` is not generated for unwindable intrinsics. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![feature(core_intrinsics)] diff --git a/tests/mir-opt/issue_120925_unsafefncast.rs b/tests/mir-opt/issue_120925_unsafefncast.rs index f80ae66efdae3..06d016d0a1597 100644 --- a/tests/mir-opt/issue_120925_unsafefncast.rs +++ b/tests/mir-opt/issue_120925_unsafefncast.rs @@ -1,5 +1,5 @@ // Verify that we do not ICE when attempting to interpret casts between fn types. -// skip-filecheck +//@ skip-filecheck static FOO: fn() = || assert_ne!(42, 43); static BAR: fn(i32, i32) = |a, b| assert_ne!(a, b); diff --git a/tests/mir-opt/issue_38669.rs b/tests/mir-opt/issue_38669.rs index 9da4c89bb1218..dd63f0e6a9738 100644 --- a/tests/mir-opt/issue_38669.rs +++ b/tests/mir-opt/issue_38669.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // check that we don't StorageDead booleans before they are used // EMIT_MIR issue_38669.main.SimplifyCfg-initial.after.mir diff --git a/tests/mir-opt/issue_41110.rs b/tests/mir-opt/issue_41110.rs index 5d042815f3b4c..730db950ae9de 100644 --- a/tests/mir-opt/issue_41110.rs +++ b/tests/mir-opt/issue_41110.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // check that we don't emit multiple drop flags when they are not needed. diff --git a/tests/mir-opt/issue_41697.rs b/tests/mir-opt/issue_41697.rs index b031f1dc72018..4b79c9d178c3e 100644 --- a/tests/mir-opt/issue_41697.rs +++ b/tests/mir-opt/issue_41697.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Regression test for #41697. Using dump-mir was triggering // artificial cycles: during type-checking, we had to get the MIR for // the constant expressions in `[u8; 2]`, which in turn would trigger diff --git a/tests/mir-opt/issue_41888.rs b/tests/mir-opt/issue_41888.rs index 1744d9f857013..fc1073c334149 100644 --- a/tests/mir-opt/issue_41888.rs +++ b/tests/mir-opt/issue_41888.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // check that we clear the "ADT master drop flag" even when there are // no fields to be dropped. diff --git a/tests/mir-opt/issue_62289.rs b/tests/mir-opt/issue_62289.rs index 6db2ec2a3719b..a1ed7d142fbc3 100644 --- a/tests/mir-opt/issue_62289.rs +++ b/tests/mir-opt/issue_62289.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // check that we don't forget to drop the Box if we early return before // initializing it // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/issue_72181.rs b/tests/mir-opt/issue_72181.rs index dea8ecbd3ec7b..04d273f1c78d9 100644 --- a/tests/mir-opt/issue_72181.rs +++ b/tests/mir-opt/issue_72181.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=1 // Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags. diff --git a/tests/mir-opt/issue_72181_1.rs b/tests/mir-opt/issue_72181_1.rs index 5c8346166aec0..1e7c70c449d98 100644 --- a/tests/mir-opt/issue_72181_1.rs +++ b/tests/mir-opt/issue_72181_1.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=1 // Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags. diff --git a/tests/mir-opt/issue_76432.rs b/tests/mir-opt/issue_76432.rs index 6d884063caafb..f881b75e78f88 100644 --- a/tests/mir-opt/issue_76432.rs +++ b/tests/mir-opt/issue_76432.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that we do not insert StorageDead at each target if StorageDead was never seen diff --git a/tests/mir-opt/issue_78192.rs b/tests/mir-opt/issue_78192.rs index a82f0e3a6653a..675f1d85f4e42 100644 --- a/tests/mir-opt/issue_78192.rs +++ b/tests/mir-opt/issue_78192.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=1 -Zinline-mir pub fn f(a: &T) -> *const T { let b: &*const T = &(a as *const T); diff --git a/tests/mir-opt/issue_91633.rs b/tests/mir-opt/issue_91633.rs index d24c2e19aa732..3922ccc422848 100644 --- a/tests/mir-opt/issue_91633.rs +++ b/tests/mir-opt/issue_91633.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 // EMIT_MIR issue_91633.hey.built.after.mir fn hey(it: &[T]) diff --git a/tests/mir-opt/issue_99325.rs b/tests/mir-opt/issue_99325.rs index 4cee4f20b31b3..6e108cd27a6ca 100644 --- a/tests/mir-opt/issue_99325.rs +++ b/tests/mir-opt/issue_99325.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_BIT_WIDTH #![feature(adt_const_params, unsized_const_params)] diff --git a/tests/mir-opt/loop_test.rs b/tests/mir-opt/loop_test.rs index bc9b659610702..fd8c7829e2a82 100644 --- a/tests/mir-opt/loop_test.rs +++ b/tests/mir-opt/loop_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z identify_regions // Tests to make sure we correctly generate falseUnwind edges in loops diff --git a/tests/mir-opt/match_arm_scopes.rs b/tests/mir-opt/match_arm_scopes.rs index 43746e993985f..2de70fed3a467 100644 --- a/tests/mir-opt/match_arm_scopes.rs +++ b/tests/mir-opt/match_arm_scopes.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that StorageDead and Drops are generated properly for bindings in // matches: diff --git a/tests/mir-opt/matches_u8.rs b/tests/mir-opt/matches_u8.rs index 86d6462567428..b7e839ebd3b17 100644 --- a/tests/mir-opt/matches_u8.rs +++ b/tests/mir-opt/matches_u8.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: MatchBranchSimplification // EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff diff --git a/tests/mir-opt/multiple_return_terminators.rs b/tests/mir-opt/multiple_return_terminators.rs index 8d83082a829eb..25cccd3bd696e 100644 --- a/tests/mir-opt/multiple_return_terminators.rs +++ b/tests/mir-opt/multiple_return_terminators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=4 // EMIT_MIR multiple_return_terminators.test.MultipleReturnTerminators.diff diff --git a/tests/mir-opt/nll/named_lifetimes_basic.rs b/tests/mir-opt/nll/named_lifetimes_basic.rs index 93f4a8bfd598a..71faf4e9e0ac9 100644 --- a/tests/mir-opt/nll/named_lifetimes_basic.rs +++ b/tests/mir-opt/nll/named_lifetimes_basic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Basic test for named lifetime translation. Check that we // instantiate the types that appear in function arguments with // suitable variables and that we setup the outlives relationship diff --git a/tests/mir-opt/nll/region_subtyping_basic.rs b/tests/mir-opt/nll/region_subtyping_basic.rs index ee74f7af2eb73..95491640ef08c 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.rs +++ b/tests/mir-opt/nll/region_subtyping_basic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Basic test for liveness constraints: the region (`R1`) that appears // in the type of `p` includes the points after `&v[0]` up to (but not // including) the call to `use_x`. The `else` branch is not included. diff --git a/tests/mir-opt/no_drop_for_inactive_variant.rs b/tests/mir-opt/no_drop_for_inactive_variant.rs index c94b36971ca2e..2aa832fbec13d 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.rs +++ b/tests/mir-opt/no_drop_for_inactive_variant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Ensure that there are no drop terminators in `unwrap` (except the one along the cleanup diff --git a/tests/mir-opt/no_spurious_drop_after_call.rs b/tests/mir-opt/no_spurious_drop_after_call.rs index cd7b8fb79425a..40377ad2aaf74 100644 --- a/tests/mir-opt/no_spurious_drop_after_call.rs +++ b/tests/mir-opt/no_spurious_drop_after_call.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that after the call to `std::mem::drop` we do not generate a diff --git a/tests/mir-opt/or_pattern.rs b/tests/mir-opt/or_pattern.rs index 0ad0ce8ead1e2..df375aed3d5b9 100644 --- a/tests/mir-opt/or_pattern.rs +++ b/tests/mir-opt/or_pattern.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir fn shortcut_second_or() { diff --git a/tests/mir-opt/packed_struct_drop_aligned.rs b/tests/mir-opt/packed_struct_drop_aligned.rs index 3abc6426e7f0c..455a3cb15b295 100644 --- a/tests/mir-opt/packed_struct_drop_aligned.rs +++ b/tests/mir-opt/packed_struct_drop_aligned.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.mir diff --git a/tests/mir-opt/pre-codegen/chained_comparison.rs b/tests/mir-opt/pre-codegen/chained_comparison.rs index 4869f1e01a028..8c359bda143a1 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.rs +++ b/tests/mir-opt/pre-codegen/chained_comparison.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs index 561bafa96516d..58e59686de7f9 100644 --- a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs +++ b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/intrinsics.rs b/tests/mir-opt/pre-codegen/intrinsics.rs index 0482b85e95f8a..42200e0b87fcd 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.rs +++ b/tests/mir-opt/pre-codegen/intrinsics.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // Checks that we do not have any branches in the MIR for the two tested functions. diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs index 952dd8cac60fd..281595f165bed 100644 --- a/tests/mir-opt/pre-codegen/loops.rs +++ b/tests/mir-opt/pre-codegen/loops.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -g //@ ignore-std-debug-assertions (debug assertions result in different inlines) //@ needs-unwind diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index be23dcdb22ae5..750a7907c15ef 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir //@ ignore-std-debug-assertions // Reason: precondition checks on ptr::read/write are under cfg(debug_assertions) diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs index 44b4b0ad888a5..6fb71bda9b441 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ compile-flags: -C overflow-checks=on -Zdump-mir-exclude-alloc-bytes diff --git a/tests/mir-opt/pre-codegen/ptr_offset.rs b/tests/mir-opt/pre-codegen/ptr_offset.rs index 120be99fc94af..1e936222a2dd3 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.rs +++ b/tests/mir-opt/pre-codegen/ptr_offset.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir //@ ignore-std-debug-assertions (precondition checks are under cfg(debug_assertions)) // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs index 5aa617227ce6b..856d57cd6e4f8 100644 --- a/tests/mir-opt/pre-codegen/range_iter.rs +++ b/tests/mir-opt/pre-codegen/range_iter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/slice_filter.rs b/tests/mir-opt/pre-codegen/slice_filter.rs index 35881ff2b18c6..a6f4a52075dff 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.rs +++ b/tests/mir-opt/pre-codegen/slice_filter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 46ded729852ab..f9049c79803ea 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 //@ only-64bit (constants for `None::<&T>` show in the output) //@ ignore-std-debug-assertions (precondition checks on ptr::add are under cfg(debug_assertions)) diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs index 940089d2d498c..51aad44579dae 100644 --- a/tests/mir-opt/pre-codegen/spans.rs +++ b/tests/mir-opt/pre-codegen/spans.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the comments we emit in MIR opts are accurate. // // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/try_identity.rs b/tests/mir-opt/pre-codegen/try_identity.rs index 264b303e381d3..876f86fe52ba7 100644 --- a/tests/mir-opt/pre-codegen/try_identity.rs +++ b/tests/mir-opt/pre-codegen/try_identity.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings diff --git a/tests/mir-opt/pre-codegen/vec_deref.rs b/tests/mir-opt/pre-codegen/vec_deref.rs index 3476e1760c0a8..75edd9bd87948 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.rs +++ b/tests/mir-opt/pre-codegen/vec_deref.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/remove_fake_borrows.rs b/tests/mir-opt/remove_fake_borrows.rs index 21c7b46ee1a35..c69fdaf125525 100644 --- a/tests/mir-opt/remove_fake_borrows.rs +++ b/tests/mir-opt/remove_fake_borrows.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the fake borrows for matches are removed after borrow checking. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/remove_never_const.rs b/tests/mir-opt/remove_never_const.rs index 81562058d808f..9307b8e760508 100644 --- a/tests/mir-opt/remove_never_const.rs +++ b/tests/mir-opt/remove_never_const.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // This was originally a regression test for #66975 - ensure that we do not generate never typed // consts in codegen. We also have tests for this that catches the error, see // tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs. diff --git a/tests/mir-opt/retag.rs b/tests/mir-opt/retag.rs index 001c559913839..11bdc5b973f9b 100644 --- a/tests/mir-opt/retag.rs +++ b/tests/mir-opt/retag.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: AddRetag // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // ignore-tidy-linelength diff --git a/tests/mir-opt/return_an_array.rs b/tests/mir-opt/return_an_array.rs index 673b5df7d7303..2af48ae6a5b97 100644 --- a/tests/mir-opt/return_an_array.rs +++ b/tests/mir-opt/return_an_array.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // this tests move up progration, which is not yet implemented fn foo() -> [u8; 1024] { diff --git a/tests/mir-opt/separate_const_switch.rs b/tests/mir-opt/separate_const_switch.rs index 0583594298026..245a47a6ecca2 100644 --- a/tests/mir-opt/separate_const_switch.rs +++ b/tests/mir-opt/separate_const_switch.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(try_trait_v2)] //@ compile-flags: -Zunsound-mir-opts diff --git a/tests/mir-opt/simplify_cfg.rs b/tests/mir-opt/simplify_cfg.rs index b1fdc5e64a0e2..8895103852472 100644 --- a/tests/mir-opt/simplify_cfg.rs +++ b/tests/mir-opt/simplify_cfg.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the goto chain starting from bb0 is collapsed. //@ compile-flags: -Cpanic=abort //@ no-prefer-dynamic diff --git a/tests/mir-opt/simplify_locals.rs b/tests/mir-opt/simplify_locals.rs index 6511b5e87e479..f0c442bd0c1a1 100644 --- a/tests/mir-opt/simplify_locals.rs +++ b/tests/mir-opt/simplify_locals.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: SimplifyLocals-before-const-prop #![feature(thread_local)] diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.rs b/tests/mir-opt/simplify_locals_removes_unused_consts.rs index 70d1555e786bc..424b25c2b745d 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.rs +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ test-mir-pass: SimplifyLocals-before-const-prop //@ compile-flags: -C overflow-checks=no diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs index 6257f5ee795ac..327c7bd6ad129 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs +++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: SimplifyLocals-before-const-prop fn map(x: Option>) -> Option> { diff --git a/tests/mir-opt/slice_drop_shim.rs b/tests/mir-opt/slice_drop_shim.rs index f34c34855a169..b8ae44ef68214 100644 --- a/tests/mir-opt/slice_drop_shim.rs +++ b/tests/mir-opt/slice_drop_shim.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -Clink-dead-code // mir-opt tests are always built as rlibs so that they seamlessly cross-compile, // so this test only produces MIR for the drop_in_place we're looking for diff --git a/tests/mir-opt/ssa_unreachable_116212.rs b/tests/mir-opt/ssa_unreachable_116212.rs index 9f1cf223e2635..f8550556f54d0 100644 --- a/tests/mir-opt/ssa_unreachable_116212.rs +++ b/tests/mir-opt/ssa_unreachable_116212.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Regression test for issue #116212. #![feature(never_type)] diff --git a/tests/mir-opt/storage_ranges.rs b/tests/mir-opt/storage_ranges.rs index 5a68d56846540..49f4fdf589132 100644 --- a/tests/mir-opt/storage_ranges.rs +++ b/tests/mir-opt/storage_ranges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR storage_ranges.main.nll.0.mir fn main() { diff --git a/tests/mir-opt/switch_to_self.rs b/tests/mir-opt/switch_to_self.rs index 51a7c13494fb4..0e963834305d3 100644 --- a/tests/mir-opt/switch_to_self.rs +++ b/tests/mir-opt/switch_to_self.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that MatchBranchSimplification doesn't ICE on a SwitchInt where // one of the targets is the block that the SwitchInt terminates. #![crate_type = "lib"] diff --git a/tests/mir-opt/tail_call_drops.rs b/tests/mir-opt/tail_call_drops.rs index 56f4852a95f4b..f58623465a1ec 100644 --- a/tests/mir-opt/tail_call_drops.rs +++ b/tests/mir-opt/tail_call_drops.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![allow(incomplete_features)] #![feature(explicit_tail_calls)] diff --git a/tests/mir-opt/tail_expr_drop_order_unwind.rs b/tests/mir-opt/tail_expr_drop_order_unwind.rs index 065e08c340963..49283a433f7c6 100644 --- a/tests/mir-opt/tail_expr_drop_order_unwind.rs +++ b/tests/mir-opt/tail_expr_drop_order_unwind.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.mir diff --git a/tests/mir-opt/tls_access.rs b/tests/mir-opt/tls_access.rs index 3dfc85def99e0..465282e1a2e7a 100644 --- a/tests/mir-opt/tls_access.rs +++ b/tests/mir-opt/tls_access.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR tls_access.main.PreCodegen.after.mir //@ compile-flags: -Zmir-opt-level=0 diff --git a/tests/mir-opt/uninhabited_enum.rs b/tests/mir-opt/uninhabited_enum.rs index 124693c0fe2cc..2ef76449e3cc3 100644 --- a/tests/mir-opt/uninhabited_enum.rs +++ b/tests/mir-opt/uninhabited_enum.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // // check that we mark blocks with `!` locals as unreachable. // (and currently don't do the same for other uninhabited types) diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.rs b/tests/mir-opt/uninhabited_fallthrough_elimination.rs index 537935d8ae433..a89f160a5f092 100644 --- a/tests/mir-opt/uninhabited_fallthrough_elimination.rs +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck enum Empty {} enum S { diff --git a/tests/mir-opt/uninhabited_not_read.rs b/tests/mir-opt/uninhabited_not_read.rs index 4c80f5e55c684..c1598d0301f67 100644 --- a/tests/mir-opt/uninhabited_not_read.rs +++ b/tests/mir-opt/uninhabited_not_read.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ edition: 2021 // In ed 2021 and below, we fallback `!` to `()`. diff --git a/tests/mir-opt/unusual_item_types.rs b/tests/mir-opt/unusual_item_types.rs index 2f05981e812eb..77174fdd2fee9 100644 --- a/tests/mir-opt/unusual_item_types.rs +++ b/tests/mir-opt/unusual_item_types.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that we don't ICE when trying to dump MIR for unusual item types and // that we don't create filenames containing `<` and `>` //@ compile-flags: -Zmir-opt-level=0 From 1e8cd1f7a68bf17b0b8cda356562968e4145a215 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 21 Apr 2026 22:40:00 +1000 Subject: [PATCH 2/2] Support `//@ skip-filecheck` in codegen and assembly tests Skipping FileCheck in codegen/assembly tests is normally not very useful, but a small number of existing tests were using `//@ build-pass` to do so anyway, so it's clearer for them to explicitly use `//@ skip-filecheck` instead. --- src/doc/rustc-dev-guide/src/tests/directives.md | 2 +- src/tools/compiletest/src/directives.rs | 1 - src/tools/compiletest/src/directives/handlers.rs | 2 +- src/tools/compiletest/src/runtest/assembly.rs | 8 +++++--- src/tools/compiletest/src/runtest/codegen.rs | 13 ++++++------- .../scalable-vectors/tuple-intrinsics.rs | 3 ++- tests/codegen-llvm/simd/simd-wide-sum.rs | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index 506deb1942db2..d536d324cb2bf 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -327,7 +327,7 @@ The following directives affect how certain command-line tools are invoked, in test suites that use those tools: - `skip-filecheck` avoids running LLVM's `FileCheck` tool in tests that would normally run it to check output. - - Used by mir-opt tests. + - Used by codegen tests, assembly tests, and mir-opt tests. - `filecheck-flags` adds extra flags when running LLVM's `FileCheck` tool. - Used by [codegen tests](compiletest.md#codegen-tests), [assembly tests](compiletest.md#assembly-tests), and diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs index fd5c9d02b6d71..d87cb915b07b8 100644 --- a/src/tools/compiletest/src/directives.rs +++ b/src/tools/compiletest/src/directives.rs @@ -442,7 +442,6 @@ impl TestProps { let check_no_run = |s| match (config.mode, s) { (TestMode::Ui, _) => (), (TestMode::Crashes, _) => (), - (TestMode::Codegen, "build-pass") => (), (mode, _) => panic!("`{s}` directive is not supported in `{mode}` tests"), }; let pass_mode = if config.parse_name_directive(ln, "check-pass") { diff --git a/src/tools/compiletest/src/directives/handlers.rs b/src/tools/compiletest/src/directives/handlers.rs index 1f2d9709ee9db..a1d6bd3088239 100644 --- a/src/tools/compiletest/src/directives/handlers.rs +++ b/src/tools/compiletest/src/directives/handlers.rs @@ -316,7 +316,7 @@ fn make_directive_handlers_map() -> HashMap<&'static str, Handler> { let directive_name = ln.name; // FIXME(Zalathar): Someday we should add unified support for declaring // and checking which modes are supported by each directive. - if !matches!(config.mode, TestMode::MirOpt) { + if !matches!(config.mode, TestMode::Assembly | TestMode::Codegen | TestMode::MirOpt) { panic!( "directive `//@ {directive_name}` is not supported by this test suite (mode: {mode:?})", mode = config.mode diff --git a/src/tools/compiletest/src/runtest/assembly.rs b/src/tools/compiletest/src/runtest/assembly.rs index 18027328abfe0..0d41c29075c43 100644 --- a/src/tools/compiletest/src/runtest/assembly.rs +++ b/src/tools/compiletest/src/runtest/assembly.rs @@ -13,9 +13,11 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - let proc_res = self.verify_with_filecheck(&output_path); - if !proc_res.status.success() { - self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + if !self.props.skip_filecheck { + let proc_res = self.verify_with_filecheck(&output_path); + if !proc_res.status.success() { + self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + } } } diff --git a/src/tools/compiletest/src/runtest/codegen.rs b/src/tools/compiletest/src/runtest/codegen.rs index 6e61ab5e46d66..60da1ff40f17d 100644 --- a/src/tools/compiletest/src/runtest/codegen.rs +++ b/src/tools/compiletest/src/runtest/codegen.rs @@ -1,4 +1,4 @@ -use super::{PassMode, TestCx}; +use super::TestCx; impl TestCx<'_> { pub(super) fn run_codegen_test(&self) { @@ -11,12 +11,11 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - if let Some(PassMode::Build) = self.pass_mode() { - return; - } - let proc_res = self.verify_with_filecheck(&output_path); - if !proc_res.status.success() { - self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + if !self.props.skip_filecheck { + let proc_res = self.verify_with_filecheck(&output_path); + if !proc_res.status.success() { + self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + } } } } diff --git a/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs b/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs index e19fc40cb9d67..7a990b29e6ca1 100644 --- a/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs +++ b/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs @@ -1,4 +1,5 @@ -//@ build-pass +// FIXME: The FileCheck directives in this test are unchecked and probably broken. +//@ skip-filecheck //@ only-aarch64 #![crate_type = "lib"] #![allow(incomplete_features, internal_features)] diff --git a/tests/codegen-llvm/simd/simd-wide-sum.rs b/tests/codegen-llvm/simd/simd-wide-sum.rs index 95117b2c74882..68febe00d1b9d 100644 --- a/tests/codegen-llvm/simd/simd-wide-sum.rs +++ b/tests/codegen-llvm/simd/simd-wide-sum.rs @@ -3,7 +3,7 @@ //@ edition: 2021 //@ only-x86_64 //@ [mir-opt3]compile-flags: -Zmir-opt-level=3 -//@ [mir-opt3]build-pass +//@ [mir-opt3] skip-filecheck // mir-opt3 is a regression test for https://github.com/rust-lang/rust/issues/98016