//! returns: 0
//! Test assigning one optional to another when destination is LOC_ADDR
//! with offset.

record Container: Copy {
    pad: i32,           // offset 0
    opt: ?i32,          // offset 4
}

static container: Container = undefined;

@default fn main() -> i32 {
    let sourceOpt: ?i32 = 42;

    set container.opt = sourceOpt;

    if let val = container.opt {
        assert val == 42;
        return 0;
    } else {
        return 1;
    }
}
