summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/custom/composite_return.rs
blob: 701d6b1ab71312feac4e39be94f66c80d03d4cb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(custom_mir, core_intrinsics)]

extern crate core;
use core::intrinsics::mir::*;

// EMIT_MIR composite_return.tuple.built.after.mir
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn tuple() -> (i32, bool) {
    mir!(
        type RET = (i32, bool);
        {
            RET.0 = 1;
            RET.1 = true;
            Return()
        }
    )
}

fn main() {
    assert_eq!(tuple(), (1, true));
}