program main
  fn i32_zero_text() -> string
    call std.num.i32_to_string
      int 0
  fn i32_negative_text() -> string
    call std.num.i32_to_string
      int -7
  fn i32_high_text() -> string
    call std.num.i32_to_string
      int 2147483647
  fn i64_low_text() -> string
    call std.num.i64_to_string
      i64 -9223372036854775808
  fn i64_high_text() -> string
    call std.num.i64_to_string
      i64 9223372036854775807
  fn i64_beyond_i32_text() -> string
    call std.num.i64_to_string
      i64 2147483648
  fn main() -> i32
    call std.io.print_string
      call i32_zero_text
    call std.io.print_string
      call i32_negative_text
    call std.io.print_string
      call i32_high_text
    call std.io.print_string
      call i64_low_text
    call std.io.print_string
      call i64_high_text
    call std.io.print_string
      call i64_beyond_i32_text
    if
      binary =
        call std.string.len
          call i64_high_text
        int 19
      int 0
      int 1
  test "i32 zero to string"
    binary =
      call i32_zero_text
      string "0"
  test "i32 negative to string"
    binary =
      call i32_negative_text
      string "-7"
  test "i32 high to string"
    binary =
      call i32_high_text
      string "2147483647"
  test "i32 negative string length"
    binary =
      call std.string.len
        call i32_negative_text
      int 2
  test "i64 low to string"
    binary =
      call i64_low_text
      string "-9223372036854775808"
  test "i64 high to string"
    binary =
      call i64_high_text
      string "9223372036854775807"
  test "i64 beyond i32 to string"
    binary =
      call i64_beyond_i32_text
      string "2147483648"
  test "i64 low string length"
    binary =
      call std.string.len
        call i64_low_text
      int 20
