module TestGhost
  use int.Int
  use list.List
  use ref.Ref

  type t = { f1 : int; ghost f2 : (int,list int) }

  let test1 (x: int) (y: t) =
    ensures { result = y.f1 }
    let r1 = ref x in
    let _ = match y with
      | { f1 = i; f2 = (_,Nil) } -> r1 := i
      | _ -> ()
    end in
    !r1
end
