Skip to content

Commit

Permalink
snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer committed Mar 22, 2022
1 parent 07af6d5 commit 7447bb8
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 332 deletions.
70 changes: 16 additions & 54 deletions compiler/test/__snapshots__/basic_functionality.1bf5759c.0.snapshot
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
basic functionality › unsafe_wasm_globals
(module
(type $none_=>_i32 (func (result i32)))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i64_=>_i32 (func (param i32 i64) (result i32)))
(type $i32_f32_=>_i32 (func (param i32 f32) (result i32)))
(type $i32_f64_=>_i32 (func (param i32 f64) (result i32)))
(type $none_=>_none (func))
(type $i32_f64_=>_i32 (func (param i32 f64) (result i32)))
(type $i32_f32_=>_i32 (func (param i32 f32) (result i32)))
(type $i32_i64_=>_i32 (func (param i32 i64) (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 $wimport__grainEnv_relocBase i32))
(import \"GRAIN$MODULE$unsafeWasmGlobalsExports\" \"GRAIN$EXPORT$_F64_VAL\" (global $gimport_unsafeWasmGlobalsExports__F64_VAL (mut f64)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"GRAIN$EXPORT$printF64\" (global $gimport_runtime/unsafe/printWasm_printF64 (mut i32)))
Expand All @@ -17,74 +16,37 @@ basic functionality › unsafe_wasm_globals
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"GRAIN$EXPORT$printI64\" (global $gimport_runtime/unsafe/printWasm_printI64 (mut i32)))
(import \"GRAIN$MODULE$unsafeWasmGlobalsExports\" \"GRAIN$EXPORT$_I32_VAL\" (global $gimport_unsafeWasmGlobalsExports__I32_VAL (mut i32)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"GRAIN$EXPORT$printI32\" (global $gimport_runtime/unsafe/printWasm_printI32 (mut i32)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"printF64\" (func $gimport_runtime/unsafe/printWasm_printF64 (param i32 f64) (result i32)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"printF32\" (func $gimport_runtime/unsafe/printWasm_printF32 (param i32 f32) (result i32)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"printI64\" (func $gimport_runtime/unsafe/printWasm_printI64 (param i32 i64) (result i32)))
(import \"GRAIN$MODULE$runtime/unsafe/printWasm\" \"printI32\" (func $gimport_runtime/unsafe/printWasm_printI32 (param i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $global_1))
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(drop
(call_indirect (type $i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(global.get $gimport_runtime/unsafe/printWasm_printI32)
(i32.const 0)
)
)
)
(call $gimport_runtime/unsafe/printWasm_printI32
(global.get $gimport_runtime/unsafe/printWasm_printI32)
(global.get $gimport_unsafeWasmGlobalsExports__I32_VAL)
(i32.load offset=8
(local.get $0)
)
)
)
(drop
(call_indirect (type $i32_i64_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(global.get $gimport_runtime/unsafe/printWasm_printI64)
(local.get $0)
)
)
)
(call $gimport_runtime/unsafe/printWasm_printI64
(global.get $gimport_runtime/unsafe/printWasm_printI64)
(global.get $gimport_unsafeWasmGlobalsExports__I64_VAL)
(i32.load offset=8
(local.get $0)
)
)
)
(drop
(call_indirect (type $i32_f32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(global.get $gimport_runtime/unsafe/printWasm_printF32)
(local.get $0)
)
)
)
(call $gimport_runtime/unsafe/printWasm_printF32
(global.get $gimport_runtime/unsafe/printWasm_printF32)
(global.get $gimport_unsafeWasmGlobalsExports__F32_VAL)
(i32.load offset=8
(local.get $0)
)
)
)
(call_indirect (type $i32_f64_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(global.get $gimport_runtime/unsafe/printWasm_printF64)
(local.get $0)
)
)
)
(call $gimport_runtime/unsafe/printWasm_printF64
(global.get $gimport_runtime/unsafe/printWasm_printF64)
(global.get $gimport_unsafeWasmGlobalsExports__F64_VAL)
(i32.load offset=8
(local.get $0)
)
)
)
(func $_start (; has Stack IR ;)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ basic functionality › comp22
(import \"GRAIN$MODULE$runtime/gc\" \"malloc\" (func $wimport_GRAIN$MODULE$runtime/gc_malloc (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $wimport_GRAIN$MODULE$runtime/gc_decRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"isnt\" (func $gimport_pervasives_isnt (param i32 i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
Expand Down Expand Up @@ -164,17 +165,10 @@ basic functionality › comp22
(local.set $0
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(local.get $0)
)
)
(call $gimport_pervasives_isnt
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
Expand All @@ -184,9 +178,6 @@ basic functionality › comp22
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(local.get $4)
)
(i32.load offset=8
(local.get $0)
)
)
(local.get $0)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
basic functionality › comp17
(module
(type $none_=>_i32 (func (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(type $none_=>_none (func))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import \"_grainEnv\" \"mem\" (memory $0 0))
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref))
(import \"_grainEnv\" \"relocBase\" (global $wimport__grainEnv_relocBase i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$isnt\" (global $gimport_pervasives_isnt (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"isnt\" (func $gimport_pervasives_isnt (param i32 i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $global_1))
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(i32.const 0)
)
)
(call $gimport_pervasives_isnt
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(i32.const 2147483646)
(i32.const -2)
(i32.load offset=8
(local.get $0)
)
)
(local.get $0)
(i32.const 0)
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ basic functionality › comp20
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$isnt\" (global $gimport_pervasives_isnt (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $wimport_GRAIN$MODULE$runtime/gc_decRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"isnt\" (func $gimport_pervasives_isnt (param i32 i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
Expand Down Expand Up @@ -152,17 +153,10 @@ basic functionality › comp20
(local.set $0
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(local.get $0)
)
)
(call $gimport_pervasives_isnt
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
Expand All @@ -172,9 +166,6 @@ basic functionality › comp20
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(local.get $4)
)
(i32.load offset=8
(local.get $0)
)
)
(local.get $0)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,32 @@
basic functionality › comp18
(module
(type $none_=>_i32 (func (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(type $none_=>_none (func))
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
(type $i32_i32_i32_=>_i32 (func (param i32 i32 i32) (result i32)))
(import \"_grainEnv\" \"mem\" (memory $0 0))
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref))
(import \"_grainEnv\" \"relocBase\" (global $wimport__grainEnv_relocBase i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef (mut i32)))
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$isnt\" (global $gimport_pervasives_isnt (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$pervasives\" \"isnt\" (func $gimport_pervasives_isnt (param i32 i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $global_1))
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(i32.const 0)
)
)
(call $gimport_pervasives_isnt
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_isnt)
)
(i32.const 9)
(i32.const 3)
(i32.load offset=8
(local.get $0)
)
)
(local.get $0)
(i32.const 0)
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/__snapshots__/exports.a2013f43.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ exports › let_rec_export
(call $_gmain)
)
)
;; custom section \"cmi\", size 625
;; custom section \"cmi\", size 642
)
23 changes: 6 additions & 17 deletions compiler/test/__snapshots__/exports.d0b9a66c.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,31 @@ exports › export9
(type $none_=>_i32 (func (result i32)))
(type $none_=>_none (func))
(import \"_grainEnv\" \"mem\" (memory $0 0))
(import \"_grainEnv\" \"tbl\" (table $tbl 0 funcref))
(import \"_grainEnv\" \"relocBase\" (global $wimport__grainEnv_relocBase i32))
(import \"GRAIN$MODULE$runtime/gc\" \"GRAIN$EXPORT$incRef\" (global $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef (mut i32)))
(import \"GRAIN$MODULE$exportStar\" \"GRAIN$EXPORT$z\" (global $gimport_exportStar_z (mut i32)))
(import \"GRAIN$MODULE$exportStar\" \"GRAIN$EXPORT$y\" (global $gimport_exportStar_y (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$exportStar\" \"y\" (func $gimport_exportStar_y (param i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
(export \"_start\" (func $_start))
(export \"GRAIN$TABLE_SIZE\" (global $global_1))
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_exportStar_y)
)
(i32.const 0)
)
)
(call $gimport_exportStar_y
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_exportStar_y)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_exportStar_z)
)
(i32.load offset=8
(local.get $0)
)
)
(local.get $0)
(i32.const 0)
)
)
)
Expand Down
21 changes: 6 additions & 15 deletions compiler/test/__snapshots__/exports.de3bf2b8.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports › export8
(import \"GRAIN$MODULE$pervasives\" \"GRAIN$EXPORT$+\" (global $gimport_pervasives_+ (mut i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"incRef\" (func $wimport_GRAIN$MODULE$runtime/gc_incRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$runtime/gc\" \"decRef\" (func $wimport_GRAIN$MODULE$runtime/gc_decRef (param i32 i32) (result i32)))
(import \"GRAIN$MODULE$exportStar\" \"y\" (func $gimport_exportStar_y (param i32 i32) (result i32)))
(global $global_1 i32 (i32.const 0))
(export \"memory\" (memory $0))
(export \"_gmain\" (func $_gmain))
Expand All @@ -25,22 +26,12 @@ exports › export8
(local.set $1
(tuple.extract 0
(tuple.make
(call_indirect (type $i32_i32_=>_i32)
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_exportStar_y)
)
(i32.const 0)
)
)
(call $gimport_exportStar_y
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_exportStar_y)
)
(i32.const 9)
(i32.load offset=8
(local.get $0)
)
)
(call $wimport_GRAIN$MODULE$runtime/gc_decRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$decRef)
Expand All @@ -60,7 +51,7 @@ exports › export8
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(global.get $gimport_pervasives_+)
)
(local.get $0)
(i32.const 0)
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/__snapshots__/functions.6eacded0.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -667,5 +667,5 @@ functions › func_recursive_closure
(call $_gmain)
)
)
;; custom section \"cmi\", size 635
;; custom section \"cmi\", size 653
)
Loading

0 comments on commit 7447bb8

Please sign in to comment.