about summary refs log tree commit diff
path: root/tests/mir-opt/copy-prop/partial_init.rs
blob: 44cc203de0d4fcf32e429fca8f430c748c541936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// skip-filecheck
// 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()
        }
    )
}