mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Make //@ skip-filecheck a normal compiletest directive
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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<String>,
|
||||
/// 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<String>,
|
||||
/// Don't automatically insert any `--check-cfg` args
|
||||
@@ -308,6 +311,7 @@ pub(crate) fn new() -> Self {
|
||||
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,
|
||||
|
||||
@@ -286,6 +286,7 @@
|
||||
"rustc-env",
|
||||
"rustfix-only-machine-applicable",
|
||||
"should-fail",
|
||||
"skip-filecheck",
|
||||
"stderr-per-bitwidth",
|
||||
"test-mir-pass",
|
||||
"unique-doc-out-dir",
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -40,7 +40,7 @@ fn check_mir_dump(&self, test_info: MiroptTest) {
|
||||
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 @@ fn check_mir_dump(&self, test_info: MiroptTest) {
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -8,7 +8,6 @@ pub struct MiroptTestFile {
|
||||
}
|
||||
|
||||
pub struct MiroptTest {
|
||||
pub run_filecheck: bool,
|
||||
pub suffix: String,
|
||||
pub files: Vec<MiroptTestFile>,
|
||||
/// 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 }
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// EMIT_MIR address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
|
||||
|
||||
fn address_of_reborrow() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//@ edition:2021
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
|
||||
enum Foo {
|
||||
Bar,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//@ edition:2021
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
|
||||
#![allow(unused)]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//@ edition:2024
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
#![feature(async_drop)]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//@edition: 2024
|
||||
//@ test-mir-pass: MentionedItems
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(async_drop)]
|
||||
#![allow(incomplete_features)]
|
||||
use std::future::AsyncDrop;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: ElaborateDrops
|
||||
//@ needs-unwind
|
||||
#![feature(allocator_api)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ edition:2024
|
||||
//@ compile-flags: -Zmir-opt-level=0 -C panic=abort
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ compile-flags: --crate-type=lib
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
use std::intrinsics::mir::*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
extern crate core;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//@ compile-flags: -Zmir-opt-level=0
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(never_type)]
|
||||
#![allow(unreachable_code)]
|
||||
|
||||
|
||||
@@ -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<u8> = Some(1);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ compile-flags: -Zmir-opt-level=0 -Z validate-mir
|
||||
//@ edition: 2024
|
||||
struct Droppy(u8);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(loop_match)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ compile-flags: -Z mir-opt-level=0 -C panic=abort
|
||||
|
||||
#![feature(deref_patterns)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
fn guard() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(min_const_generics)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ ignore-endian-big
|
||||
extern "C" {
|
||||
static X: i32;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
|
||||
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
// Test that we generate StorageDead on unwind paths for coroutines.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//! Tests that coroutines that cannot return or unwind don't have unnecessary
|
||||
//! panic branches.
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// Test graphviz dataflow output
|
||||
//@ compile-flags: -Z dump-mir=main -Z dump-mir-dataflow
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_test.main.Derefer.diff
|
||||
fn main() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_test_multiple.main.Derefer.diff
|
||||
fn main() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ test-mir-pass: DestinationPropagation
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: Inline
|
||||
//@ compile-flags: --crate-type=lib -C panic=abort
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: ElaborateBoxDerefs
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: EnumSizeOpt
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
//@ compile-flags: -Zunsound-mir-opts
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ compile-flags: -Zmir-opt-level=0
|
||||
|
||||
// Tests that the `<fn() as Fn>` shim does not create a `Call` terminator with a `Self` callee
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ needs-asm-support
|
||||
|
||||
// `global_asm!` gets a fake body, make sure it is handled correctly
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
// Test graphviz output
|
||||
//@ compile-flags: -Z dump-mir-graphviz
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR gvn_on_unsafe_binder.test.GVN.diff
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: GVN
|
||||
//@ only-64bit
|
||||
//@ compile-flags: -Z mir-enable-passes=+Inline
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -O
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
|
||||
#![feature(never_type)]
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ test-mir-pass: Inline
|
||||
//@ compile-flags: --crate-type=lib -C panic=abort
|
||||
|
||||
|
||||
@@ -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".
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
//@ skip-filecheck
|
||||
//@ compile-flags: -Zmir-opt-level=1 -Zinline-mir
|
||||
pub fn f<T>(a: &T) -> *const T {
|
||||
let b: &*const T = &(a as *const T);
|
||||
|
||||
@@ -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<T>(it: &[T])
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user