rust/tests/mir-opt/copy-prop/partial_init.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
417 B
Rust
Raw Normal View History

// skip-filecheck
2023-05-10 15:25:02 +00:00
//@ unit-test: CopyProp
// Verify that we do not ICE on partial initializations.
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;
// EMIT_MIR partial_init.main.CopyProp.diff
#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
pub fn main() {
mir! (
let x: (isize, );
{
x.0 = 1;
Return()
}
)
}