program main
  struct Point
    field x: i32
    field y: i32
  fn make_point(x: i32, y: i32) -> Point
    construct Point : Point
      field x
        var x : i32
      field y
        var y : i32
  fn point_x(p: Point) -> i32
    field-access x : i32
      var p : Point
  fn point_sum(p: Point) -> i32
    binary + : i32
      field-access x : i32
        var p : Point
      field-access y : i32
        var p : Point
  fn local_point_sum() -> i32
    local let p : unit
      call make_point : Point
        int 20 : i32
        int 22 : i32
    call point_sum : i32
      var p : Point
  fn main() -> i32
    call local_point_sum : i32
  test "struct local value flow"
    binary = : bool
      call local_point_sum : i32
      int 42 : i32
  test "struct parameter value flow"
    binary = : bool
      call point_x : i32
        call make_point : Point
          int 7 : i32
          int 9 : i32
      int 7 : i32
  test "stored struct field access"
    local let p : unit
      call make_point : Point
        int 3 : i32
        int 4 : i32
    binary = : bool
      field-access y : i32
        var p : Point
      int 4 : i32
