Skip to content

Commit

Permalink
tests: memory
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJOHN974 committed Dec 18, 2023
1 parent e7eb24d commit 7ff97ae
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions cranelift/zkasm_data/memory-i32.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
(module
(import "env" "assert_eq" (func $assert_eq (param i32) (param i32)))
(memory 1)
(data (i32.const 0) "abcdefghijklmnopqrstuvwxyz")
(func $main
i32.const 0
i32.load8_u offset=0
i32.const 97
call $assert_eq
i32.const 0
i32.load8_u align=1
i32.const 97
call $assert_eq
i32.const 0
i32.load8_u offset=1 align=1
i32.const 98
call $assert_eq
i32.const 0
i32.load8_u offset=2 align=1
i32.const 99
call $assert_eq
i32.const 0
i32.load8_u offset=25 align=1
i32.const 122
call $assert_eq
i32.const 0
i32.load8_s offset=0
i32.const 97
call $assert_eq
i32.const 0
i32.load8_s align=1
i32.const 97
call $assert_eq
i32.const 0
i32.load8_s offset=1 align=1
i32.const 98
call $assert_eq
i32.const 0
i32.load8_s offset=2 align=1
i32.const 99
call $assert_eq
i32.const 0
i32.load8_s offset=25 align=1
i32.const 122
call $assert_eq
i32.const 0
i32.load16_u offset=0
i32.const 25185
call $assert_eq
i32.const 0
i32.load16_u align=1
i32.const 25185
call $assert_eq
i32.const 0
i32.load16_u offset=1 align=1
i32.const 25442
call $assert_eq
i32.const 0
i32.load16_u offset=2 align=2
i32.const 25699
call $assert_eq
i32.const 0
i32.load16_u offset=25 align=2
i32.const 122
call $assert_eq
i32.const 0
i32.load16_s offset=0
i32.const 25185
call $assert_eq
i32.const 0
i32.load16_s align=1
i32.const 25185
call $assert_eq
i32.const 0
i32.load16_s offset=1 align=1
i32.const 25442
call $assert_eq
i32.const 0
i32.load16_s offset=2 align=2
i32.const 25699
call $assert_eq
i32.const 0
i32.load16_s offset=25 align=2
i32.const 122
call $assert_eq
i32.const 0
i32.load offset=0
i32.const 1684234849
call $assert_eq
i32.const 0
i32.load align=1
i32.const 1684234849
call $assert_eq
i32.const 0
i32.load offset=1 align=1
i32.const 1701077858
call $assert_eq
i32.const 0
i32.load offset=2 align=2
i32.const 1717920867
call $assert_eq
i32.const 0
i32.load offset=25 align=4
i32.const 122
call $assert_eq)
(start $main)
)

0 comments on commit 7ff97ae

Please sign in to comment.