mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
mir-opt tests: rename unit-test -> test-mir-pass
This commit is contained in:
parent
a61b14d15e
commit
75d0fdd967
@ -244,7 +244,7 @@ mod directives {
|
||||
pub const STDERR_PER_BITWIDTH: &'static str = "stderr-per-bitwidth";
|
||||
pub const INCREMENTAL: &'static str = "incremental";
|
||||
pub const KNOWN_BUG: &'static str = "known-bug";
|
||||
pub const MIR_UNIT_TEST: &'static str = "unit-test";
|
||||
pub const TEST_MIR_PASS: &'static str = "test-mir-pass";
|
||||
pub const REMAP_SRC_BASE: &'static str = "remap-src-base";
|
||||
pub const COMPARE_OUTPUT_LINES_BY_SUBSET: &'static str = "compare-output-lines-by-subset";
|
||||
pub const LLVM_COV_FLAGS: &'static str = "llvm-cov-flags";
|
||||
@ -549,7 +549,7 @@ impl TestProps {
|
||||
|
||||
config.set_name_value_directive(
|
||||
ln,
|
||||
MIR_UNIT_TEST,
|
||||
TEST_MIR_PASS,
|
||||
&mut self.mir_unit_test,
|
||||
|s| s.trim().to_string(),
|
||||
);
|
||||
@ -922,7 +922,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
|
||||
"should-fail",
|
||||
"should-ice",
|
||||
"stderr-per-bitwidth",
|
||||
"unit-test",
|
||||
"test-mir-pass",
|
||||
"unset-exec-env",
|
||||
"unset-rustc-env",
|
||||
// tidy-alphabetical-end
|
||||
|
@ -14,17 +14,18 @@ presence of pointers in constants or other bit width dependent things. In that c
|
||||
|
||||
to your test, causing separate files to be generated for 32bit and 64bit systems.
|
||||
|
||||
## Unit testing
|
||||
## Testing a particular MIR pass
|
||||
|
||||
If you are only testing the behavior of a particular mir-opt pass on some specific input (as is
|
||||
usually the case), you should add
|
||||
|
||||
```
|
||||
// unit-test: PassName
|
||||
//@ test-mir-pass: PassName
|
||||
```
|
||||
|
||||
to the top of the file. This makes sure that other passes don't run which means you'll get the input
|
||||
you expected and your test won't break when other code changes.
|
||||
you expected and your test won't break when other code changes. This also lets you test passes
|
||||
that are disabled by default.
|
||||
|
||||
## Emit a diff of the mir for a specific optimization
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: SimplifyCfg-pre-optimizations
|
||||
//@ test-mir-pass: SimplifyCfg-pre-optimizations
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Retagging (from Stacked Borrows) relies on the array index being a fresh
|
||||
// temporary, so that side-effects cannot change it.
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: ElaborateDrops
|
||||
//@ test-mir-pass: ElaborateDrops
|
||||
//@ needs-unwind
|
||||
// this tests move up progration, which is not yet implemented
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: ElaborateDrops
|
||||
//@ test-mir-pass: ElaborateDrops
|
||||
//@ needs-unwind
|
||||
|
||||
#![feature(rustc_attrs, stmt_expr_attributes)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
static FOO: &[(Option<i32>, &[&str])] =
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR const_allocation2.main.GVN.after.mir
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR const_allocation3.main.GVN.after.mir
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: ConstDebugInfo
|
||||
//@ test-mir-pass: ConstDebugInfo
|
||||
//@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN
|
||||
|
||||
struct Point {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR address_of_pair.fn0.GVN.diff
|
||||
pub fn fn0() -> bool {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -O
|
||||
|
||||
// EMIT_MIR aggregate.main.GVN.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
// EMIT_MIR bad_op_div_by_zero.main.GVN.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
// EMIT_MIR bad_op_mod_by_zero.main.GVN.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR boolean_identities.test.GVN.diff
|
||||
pub fn test(x: bool, y: bool) -> bool {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -O
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR cast.main.GVN.diff
|
||||
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -C overflow-checks=on
|
||||
|
||||
// EMIT_MIR checked_add.main.GVN.diff
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -Zmir-opt-level=1
|
||||
|
||||
trait NeedsDrop: Sized {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
|
||||
// `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -C overflow-checks=on
|
||||
|
||||
// EMIT_MIR indirect.main.GVN.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// Check that we do not propagate past an indirect mutation.
|
||||
#![feature(raw_ref_op)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -Zmir-enable-passes=+Inline
|
||||
|
||||
// After inlining, this will contain a `CheckedBinaryOp`.
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -Zmir-enable-passes=+RemoveZsts
|
||||
// Verify that we can pretty print invalid constants.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// Due to a bug in propagating scalar pairs the assertion below used to fail. In the expected
|
||||
// outputs below, after GVN this is how _2 would look like with the bug:
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// This used to ICE in const-prop
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mult_by_zero.test.GVN.diff
|
||||
fn test(x: i32) -> i32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mutable_variable.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mutable_variable_aggregate.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mutable_variable_aggregate_mut_ref.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mutable_variable_aggregate_partial_read.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// Verify that we do not propagate the contents of this mutable static.
|
||||
static mut STATIC: u32 = 0x42424242;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR mutable_variable_unprop_assign.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
#![feature(offset_of_enum, offset_of_nested)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -O
|
||||
|
||||
// Regression test for https://github.com/rust-lang/rust/issues/118328
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
#[inline(never)]
|
||||
fn read(_: usize) { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
static FOO: u8 = 2;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR ref_deref.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This does not currently propagate (#67862)
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
|
||||
// EMIT_MIR ref_deref_project.main.GVN.diff
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR reify_fn_ptr.main.GVN.diff
|
||||
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ compile-flags: -C overflow-checks=on
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
// EMIT_MIR scalar_literal_propagation.main.GVN.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -Zmir-enable-passes=+InstSimplify
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -Zmir-enable-passes=+SimplifyConstCondition-after-const-prop
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
//@ compile-flags: -O --crate-type=lib
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR tuple_literal_propagation.main.GVN.diff
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: GVN
|
||||
//@ test-mir-pass: GVN
|
||||
// EMIT_MIR while_let_loops.change_loop_body.GVN.diff
|
||||
|
||||
pub fn change_loop_body() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
#![allow(unused_assignments)]
|
||||
|
@ -1,7 +1,7 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//! Tests that we bail out when there are multiple assignments to the same local.
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
fn val() -> i32 {
|
||||
1
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// Check that CopyProp does propagate return values of call terminators.
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
//@ needs-unwind
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
@ -2,7 +2,7 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Check that CopyProp does not propagate an assignment to a function argument
|
||||
// (doing so can break usages of the original argument value)
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
fn dummy(x: u8) -> u8 {
|
||||
x
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
#![allow(unused_assignments)]
|
||||
|
@ -1,7 +1,7 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//! Tests that cyclic assignments don't hang CopyProp, and result in reasonable code.
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
fn val() -> i32 {
|
||||
1
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
fn id<T>(x: T) -> T {
|
||||
x
|
||||
|
@ -3,7 +3,7 @@
|
||||
// This is a copy of the `dead_stores_79191` test, except that we turn on DSE. This demonstrates
|
||||
// that that pass enables this one to do more optimizations.
|
||||
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
//@ compile-flags: -Zmir-enable-passes=+DeadStoreElimination
|
||||
|
||||
fn id<T>(x: T) -> T {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
// EMIT_MIR issue_107511.main.CopyProp.diff
|
||||
fn main() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Test that we do not move multiple times from the same local.
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
// EMIT_MIR move_arg.f.CopyProp.diff
|
||||
pub fn f<T: Copy>(a: T) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
#![allow(unused_assignments)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
//
|
||||
// This attempts to mutate `a` via a pointer derived from `addr_of!(a)`. That is UB
|
||||
// according to Miri. However, the decision to make this UB - and to allow
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
#![allow(unused_assignments)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
// Verify that we do not ICE on partial initializations.
|
||||
|
||||
#![feature(custom_mir, core_intrinsics)]
|
||||
|
@ -1,7 +1,7 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Check that CopyProp considers reborrows as not mutating the pointer.
|
||||
//@ unit-test: CopyProp
|
||||
//@ test-mir-pass: CopyProp
|
||||
|
||||
#![feature(raw_ref_op)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
// EMIT_MIR array_index.main.DataflowConstProp.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR boolean_identities.test.DataflowConstProp.diff
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR cast.main.DataflowConstProp.diff
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
//@ compile-flags: -Coverflow-checks=on
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
//@ compile-flags: -Zmir-enable-passes=+GVN,+Inline
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
#![feature(custom_mir, core_intrinsics, rustc_attrs)]
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR if.main.DataflowConstProp.diff
|
||||
// CHECK-LABEL: fn main(
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
//@ compile-flags: -Zmir-enable-passes=+Inline
|
||||
|
||||
// EMIT_MIR inherit_overflow.main.DataflowConstProp.diff
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR issue_81605.f.DataflowConstProp.diff
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR mult_by_zero.test.DataflowConstProp.diff
|
||||
// CHECK-LABEL: fn test(
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
#![feature(offset_of_nested)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
#[inline(never)]
|
||||
fn escape<T>(x: &T) {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// The struct has scalar ABI, but is not a scalar type.
|
||||
// Make sure that we handle this correctly.
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR self_assign.main.DataflowConstProp.diff
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR self_assign_add.main.DataflowConstProp.diff
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
// used to modify `x.1` - if it did not, then it might incorrectly assume that it
|
||||
// can infer the value of `x.1` at the end of this function.
|
||||
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
// EMIT_MIR sibling_ptr.main.DataflowConstProp.diff
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
//@ compile-flags: -Zmir-enable-passes=+InstSimplify
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
|
||||
fn foo(n: i32) {}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
//@ compile-flags: -O --crate-type=lib
|
||||
//@ ignore-endian-big
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
@ -1,4 +1,4 @@
|
||||
//@ unit-test: DataflowConstProp
|
||||
//@ test-mir-pass: DataflowConstProp
|
||||
// EMIT_MIR_FOR_EACH_BIT_WIDTH
|
||||
|
||||
// EMIT_MIR tuple.main.DataflowConstProp.diff
|
||||
|
@ -1,5 +1,5 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DeadStoreElimination-final
|
||||
//@ test-mir-pass: DeadStoreElimination-final
|
||||
//@ compile-flags: -Zmir-enable-passes=+CopyProp
|
||||
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -2,7 +2,7 @@
|
||||
// report that *all* of these stores are live.
|
||||
//
|
||||
//@ needs-unwind
|
||||
//@ unit-test: DeadStoreElimination-initial
|
||||
//@ test-mir-pass: DeadStoreElimination-initial
|
||||
|
||||
#![feature(core_intrinsics, custom_mir)]
|
||||
use std::intrinsics::mir::*;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Verify that we account for the `PlaceMention` statement as a use of the tuple,
|
||||
// and don't remove it as a dead store.
|
||||
//
|
||||
//@ unit-test: DeadStoreElimination-initial
|
||||
//@ test-mir-pass: DeadStoreElimination-initial
|
||||
//@ compile-flags: -Zmir-keep-place-mention
|
||||
|
||||
// EMIT_MIR place_mention.main.DeadStoreElimination-initial.diff
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Test that we don't remove pointer to int casts or retags
|
||||
//@ unit-test: DeadStoreElimination-initial
|
||||
//@ test-mir-pass: DeadStoreElimination-initial
|
||||
//@ compile-flags: -Zmir-emit-retag
|
||||
|
||||
// EMIT_MIR provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff
|
||||
|
@ -1,6 +1,6 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//@ unit-test: DeduplicateBlocks
|
||||
//@ test-mir-pass: DeduplicateBlocks
|
||||
|
||||
// EMIT_MIR deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
|
||||
pub const fn is_line_doc_comment_2(s: &str) -> bool {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: Derefer
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_complex_case.main.Derefer.diff
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: Derefer
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_inline_test.main.Derefer.diff
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: Derefer
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_terminator_test.main.Derefer.diff
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: Derefer
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_test.main.Derefer.diff
|
||||
fn main() {
|
||||
let mut a = (42,43);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// skip-filecheck
|
||||
//@ unit-test: Derefer
|
||||
//@ test-mir-pass: Derefer
|
||||
// EMIT_MIR derefer_test_multiple.main.Derefer.diff
|
||||
fn main () {
|
||||
let mut a = (42, 43);
|
||||
|
@ -1,7 +1,7 @@
|
||||
// skip-filecheck
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
//! Tests that assignment in both branches of an `if` are eliminated.
|
||||
//@ unit-test: DestinationPropagation
|
||||
//@ test-mir-pass: DestinationPropagation
|
||||
fn val() -> i32 {
|
||||
1
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Check that DestinationPropagation does not propagate an assignment to a function argument
|
||||
// (doing so can break usages of the original argument value)
|
||||
//@ unit-test: DestinationPropagation
|
||||
//@ test-mir-pass: DestinationPropagation
|
||||
fn dummy(x: u8) -> u8 {
|
||||
x
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user