//! returns: 0
//! When a nested record field from a static variable is passed by value,
//! we only the base address and ignores the offset,
//! causing the function to receive the wrong data.

record Inner {
    value: i32,
}

record Outer {
    padding: i32,
    inner: Inner,
}

static global: Outer = undefined;

fn readInner(i: Inner) -> i32 {
    return i.value;
}

@default fn main() -> i32 {
    global = Outer { padding: 0, inner: Inner { value: 42 } };

    assert readInner(global.inner) == 42;
    return 0;
}
