-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): Add basic testing for binop assignments (#1939)
- Loading branch information
1 parent
36cf579
commit 1a25bf0
Showing
6 changed files
with
409 additions
and
0 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
compiler/test/__snapshots__/basic_functionality.00bcbc39.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
64 changes: 64 additions & 0 deletions
64
compiler/test/__snapshots__/basic_functionality.06bd2a80.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
85 changes: 85 additions & 0 deletions
85
compiler/test/__snapshots__/basic_functionality.7599b5a6.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
85 changes: 85 additions & 0 deletions
85
compiler/test/__snapshots__/basic_functionality.79ea1ccc.0.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
Oops, something went wrong.