summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/copy-prop/partial_init.rs
blob: f5ab9974f71e514b7e49a26939508bcd2d9cb359 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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()
        }
    )
}