(module main)

(fn immediate_second () -> i32
  (index (array i32 10 20 30) 1))

(fn local_sum () -> i32
  (let values (array i32 3) (array i32 4 5 6))
  (+ (index values 0) (index values 2)))

(test "immediate array index"
  (= (immediate_second) 20))

(test "array local index"
  (let values (array i32 3) (array i32 7 8 9))
  (= (index values 2) 9))

(fn main () -> i32
  (+ (immediate_second) (local_sum)))
