//! returns: 0
//! Test assigning to an optional field stored at LOC_ADDR with offset.

record Container {
    pad: i32,           // offset 0, size 4
    opt: ?i32,          // offset 4, size 8 (tag + value)
}

static container: Container = undefined;

@default fn main() -> i32 {
    container.opt = 42;

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