-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #693
- Loading branch information
1 parent
6dd9680
commit 74a196d
Showing
5 changed files
with
219 additions
and
1 deletion.
There are no files selected for viewing
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
71 changes: 71 additions & 0 deletions
71
compiler/test/__snapshots__/basic_functionality.31e0d562.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,71 @@ | ||
basic functionality › infinity | ||
(module | ||
(type $none_=>_none (func)) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_gtype_metadata\" (func $_gtype_metadata)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gtype_metadata | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(nop) | ||
) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(return | ||
(block $cleanup_locals.3 (result i32) | ||
(local.set $0 | ||
(block $compile_block.2 (result i32) | ||
(block $allocate_number.1 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 16) | ||
) | ||
) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 2) | ||
) | ||
(f64.store offset=8 | ||
(local.get $0) | ||
(f64.const inf) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 240 | ||
) |
71 changes: 71 additions & 0 deletions
71
compiler/test/__snapshots__/basic_functionality.4d1501b9.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,71 @@ | ||
basic functionality › nan | ||
(module | ||
(type $none_=>_none (func)) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_gtype_metadata\" (func $_gtype_metadata)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gtype_metadata | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(nop) | ||
) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(return | ||
(block $cleanup_locals.3 (result i32) | ||
(local.set $0 | ||
(block $compile_block.2 (result i32) | ||
(block $allocate_number.1 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 16) | ||
) | ||
) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 2) | ||
) | ||
(f64.store offset=8 | ||
(local.get $0) | ||
(f64.const nan:0x8000000000000) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 235 | ||
) |
71 changes: 71 additions & 0 deletions
71
compiler/test/__snapshots__/basic_functionality.8e01d666.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,71 @@ | ||
basic functionality › infinity_neg | ||
(module | ||
(type $none_=>_none (func)) | ||
(type $none_=>_i32 (func (result i32))) | ||
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) | ||
(import \"_grainEnv\" \"mem\" (memory $0 0)) | ||
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref)) | ||
(import \"_grainEnv\" \"relocBase\" (global $relocBase_0 i32)) | ||
(import \"_grainEnv\" \"moduleRuntimeId\" (global $moduleRuntimeId_0 i32)) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$malloc\" (global $GRAIN$EXPORT$malloc_0 (mut i32))) | ||
(import \"GRAIN$MODULE$runtime/gc\" \"malloc\" (func $malloc_0 (param i32 i32) (result i32))) | ||
(global $GRAIN$TABLE_SIZE i32 (i32.const 0)) | ||
(elem $elem (global.get $relocBase_0)) | ||
(export \"memory\" (memory $0)) | ||
(export \"_gmain\" (func $_gmain)) | ||
(export \"_gtype_metadata\" (func $_gtype_metadata)) | ||
(export \"_start\" (func $_start)) | ||
(export \"GRAIN$TABLE_SIZE\" (global $GRAIN$TABLE_SIZE)) | ||
(func $_gtype_metadata | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(nop) | ||
) | ||
(func $_gmain (result i32) | ||
(local $0 i32) | ||
(local $1 i32) | ||
(local $2 i32) | ||
(local $3 i64) | ||
(local $4 f32) | ||
(local $5 f64) | ||
(return | ||
(block $cleanup_locals.3 (result i32) | ||
(local.set $0 | ||
(block $compile_block.2 (result i32) | ||
(block $allocate_number.1 (result i32) | ||
(i32.store | ||
(local.tee $0 | ||
(call $malloc_0 | ||
(global.get $GRAIN$EXPORT$malloc_0) | ||
(i32.const 16) | ||
) | ||
) | ||
(i32.const 5) | ||
) | ||
(i32.store offset=4 | ||
(local.get $0) | ||
(i32.const 2) | ||
) | ||
(f64.store offset=8 | ||
(local.get $0) | ||
(f64.const -inf) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(local.get $0) | ||
) | ||
) | ||
) | ||
(func $_start | ||
(drop | ||
(call $_gmain) | ||
) | ||
) | ||
;; custom section \"cmi\", size 244 | ||
) |
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