Skip to content

Commit

Permalink
chore(tests): Add basic testing for binop assignments (#1939)
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake authored Dec 31, 2023
1 parent 36cf579 commit 1a25bf0
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
basic functionality › assignment1
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import \"_genv\" \"tbl\" (table $tbl 0 funcref))
(import \"_genv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32))
(import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32)))
(import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$*\" (global $*_1117 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"*\" (func $*_1117 (param i32 i32 i32) (result i32)))
(global $t_1113 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(memory $0 0)
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE))
(func $_gmain (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i64)
(local $4 f32)
(local $5 f64)
(local $6 i32)
(block $compile_block.6 (result i32)
(block $compile_store.2
(global.set $t_1113
(i32.const 5)
)
(block $do_backpatches.1
)
)
(block $compile_store.4
(local.set $6
(call $*_1117
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $*_1117)
)
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $t_1113)
)
(i32.const 5)
)
)
(block $do_backpatches.3
)
)
(block $compile_set.5 (result i32)
(global.set $t_1113
(tuple.extract 0
(tuple.make
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(local.get $6)
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $t_1113)
)
)
)
)
(i32.const 1879048190)
)
)
)
(func $_start
(drop
(call $_gmain)
)
)
;; custom section \"cmi\", size 317
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
basic functionality › assignment1
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
(import \"_genv\" \"tbl\" (table $tbl 0 funcref))
(import \"_genv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32))
(import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32)))
(import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(global $t_1113 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(memory $0 0)
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE))
(func $_gmain (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i64)
(local $4 f32)
(local $5 f64)
(block $compile_block.4 (result i32)
(block $compile_store.2
(global.set $t_1113
(i32.const 5)
)
(block $do_backpatches.1
)
)
(block $compile_set.3 (result i32)
(global.set $t_1113
(tuple.extract 0
(tuple.make
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(i32.const 3)
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $t_1113)
)
)
)
)
(i32.const 1879048190)
)
)
)
(func $_start
(drop
(call $_gmain)
)
)
;; custom section \"cmi\", size 317
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
basic functionality › assignment1
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import \"_genv\" \"tbl\" (table $tbl 0 funcref))
(import \"_genv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32))
(import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32)))
(import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$+\" (global $+_1117 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"+\" (func $+_1117 (param i32 i32 i32) (result i32)))
(global $t_1113 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(memory $0 0)
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE))
(func $_gmain (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i64)
(local $4 f32)
(local $5 f64)
(local $6 i32)
(block $compile_block.6 (result i32)
(block $compile_store.2
(global.set $t_1113
(i32.const 3)
)
(block $do_backpatches.1
)
)
(block $compile_store.4
(local.set $6
(call $+_1117
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $+_1117)
)
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $t_1113)
)
(i32.const 5)
)
)
(block $do_backpatches.3
)
)
(block $compile_set.5 (result i32)
(global.set $t_1113
(tuple.extract 0
(tuple.make
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(local.get $6)
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $t_1113)
)
)
)
)
(i32.const 1879048190)
)
)
)
(func $_start
(drop
(call $_gmain)
)
)
;; custom section \"cmi\", size 317
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
basic functionality › assignment1
(module
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import \"_genv\" \"tbl\" (table $tbl 0 funcref))
(import \"_genv\" \"relocBase\" (global $relocBase_0 i32))
(import \"_genv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32))
(import \"_genv\" \"runtimeHeapStart\" (global $runtimeHeapStart_0 i32))
(import \"_genv\" \"runtimeHeapNextPtr\" (global $runtimeHeapNextPtr_0 (mut i32)))
(import \"_genv\" \"metadataPtr\" (global $metadataPtr_0 i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $GRAIN$EXPORT$incRef_0 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$decRef\" (global $GRAIN$EXPORT$decRef_0 (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$-\" (global $-_1117 (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $incRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $decRef_0 (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"-\" (func $-_1117 (param i32 i32 i32) (result i32)))
(global $t_1113 (mut i32) (i32.const 0))
(global $GRAIN$TABLE_SIZE i32 (i32.const 0))
(memory $0 0)
(elem $elem (global.get $relocBase_0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE))
(func $_gmain (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i64)
(local $4 f32)
(local $5 f64)
(local $6 i32)
(block $compile_block.6 (result i32)
(block $compile_store.2
(global.set $t_1113
(i32.const 5)
)
(block $do_backpatches.1
)
)
(block $compile_store.4
(local.set $6
(call $-_1117
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $-_1117)
)
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(global.get $t_1113)
)
(i32.const 5)
)
)
(block $do_backpatches.3
)
)
(block $compile_set.5 (result i32)
(global.set $t_1113
(tuple.extract 0
(tuple.make
(call $incRef_0
(global.get $GRAIN$EXPORT$incRef_0)
(local.get $6)
)
(call $decRef_0
(global.get $GRAIN$EXPORT$decRef_0)
(global.get $t_1113)
)
)
)
)
(i32.const 1879048190)
)
)
)
(func $_start
(drop
(call $_gmain)
)
)
;; custom section \"cmi\", size 317
)
Loading

0 comments on commit 1a25bf0

Please sign in to comment.