Skip to content

Commit

Permalink
Add snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer committed Mar 31, 2022
1 parent 71dffb4 commit 618840f
Show file tree
Hide file tree
Showing 240 changed files with 8,603 additions and 14,279 deletions.
62 changes: 18 additions & 44 deletions compiler/test/__snapshots__/arrays.0f9e7d37.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ arrays › array_access
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(i32.store
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
(i32.const 0)
)
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
)
(i32.const 4)
Expand Down Expand Up @@ -67,17 +61,14 @@ arrays › array_access
)
(if
(i32.lt_s
(i32.const 0)
(local.tee $0
(i32.const 0)
)
(i32.sub
(i32.const 0)
(i32.load offset=4
(local.tee $2
(tuple.extract 0
(tuple.make
(global.get $global_0)
(i32.const 0)
)
)
(local.tee $1
(global.get $global_0)
)
)
)
Expand All @@ -95,9 +86,9 @@ arrays › array_access
(if
(i32.le_s
(i32.load offset=4
(local.get $2)
(local.get $1)
)
(local.get $1)
(local.get $0)
)
(block
(drop
Expand All @@ -109,33 +100,16 @@ arrays › array_access
(unreachable)
)
)
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(if (result i32)
(i32.lt_u
(local.get $1)
(i32.const 0)
)
(i32.add
(local.get $1)
(i32.load offset=4
(local.get $2)
)
)
(local.get $1)
)
(i32.const 2)
)
(local.get $2)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(local.get $0)
(i32.const 2)
)
(local.get $1)
)
(local.get $0)
)
)
)
Expand Down
18 changes: 4 additions & 14 deletions compiler/test/__snapshots__/arrays.24453e6e.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ arrays › array1_trailing
(local $0 i32)
(i32.store
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
(i32.const 0)
)
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
)
(i32.const 4)
Expand All @@ -44,12 +39,7 @@ arrays › array1_trailing
(local.get $0)
(i32.const 7)
)
(tuple.extract 0
(tuple.make
(local.get $0)
(local.get $0)
)
)
(local.get $0)
)
(func $_start (; has Stack IR ;)
(drop
Expand Down
64 changes: 24 additions & 40 deletions compiler/test/__snapshots__/arrays.28fcc534.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ arrays › array_access4
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(i32.store
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
(i32.const 0)
)
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
)
(i32.const 4)
Expand Down Expand Up @@ -67,19 +61,14 @@ arrays › array_access4
)
(if
(i32.lt_s
(local.tee $1
(local.tee $0
(i32.const -2)
)
(i32.sub
(i32.const 0)
(i32.load offset=4
(local.tee $2
(tuple.extract 0
(tuple.make
(global.get $global_0)
(i32.const 0)
)
)
(local.tee $1
(global.get $global_0)
)
)
)
Expand All @@ -97,9 +86,9 @@ arrays › array_access4
(if
(i32.le_s
(i32.load offset=4
(local.get $2)
(local.get $1)
)
(local.get $1)
(local.get $0)
)
(block
(drop
Expand All @@ -111,33 +100,28 @@ arrays › array_access4
(unreachable)
)
)
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(if (result i32)
(i32.lt_s
(local.get $1)
(i32.const 0)
)
(i32.add
(local.get $1)
(i32.load offset=4
(local.get $2)
)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(if (result i32)
(i32.lt_s
(local.get $0)
(i32.const 0)
)
(i32.add
(local.get $0)
(i32.load offset=4
(local.get $1)
)
(i32.const 2)
)
(local.get $2)
(local.get $0)
)
(i32.const 2)
)
(local.get $1)
)
(local.get $0)
)
)
)
Expand Down
60 changes: 16 additions & 44 deletions compiler/test/__snapshots__/arrays.4c8c9f91.0.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@ arrays › array_access2
(func $_gmain (; has Stack IR ;) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(i32.store
(local.tee $0
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
(i32.const 0)
)
(call $wimport_GRAIN$MODULE$runtime/gc_malloc
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$malloc)
(i32.const 20)
)
)
(i32.const 4)
Expand Down Expand Up @@ -67,19 +61,14 @@ arrays › array_access2
)
(if
(i32.lt_s
(local.tee $1
(local.tee $0
(i32.const 1)
)
(i32.sub
(i32.const 0)
(i32.load offset=4
(local.tee $2
(tuple.extract 0
(tuple.make
(global.get $global_0)
(i32.const 0)
)
)
(local.tee $1
(global.get $global_0)
)
)
)
Expand All @@ -97,9 +86,9 @@ arrays › array_access2
(if
(i32.le_s
(i32.load offset=4
(local.get $2)
(local.get $1)
)
(local.get $1)
(local.get $0)
)
(block
(drop
Expand All @@ -111,33 +100,16 @@ arrays › array_access2
(unreachable)
)
)
(tuple.extract 0
(tuple.make
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(if (result i32)
(i32.lt_u
(local.get $1)
(i32.const 0)
)
(i32.add
(local.get $1)
(i32.load offset=4
(local.get $2)
)
)
(local.get $1)
)
(i32.const 2)
)
(local.get $2)
)
(call $wimport_GRAIN$MODULE$runtime/gc_incRef
(global.get $wimport_GRAIN$MODULE$runtime/gc_GRAIN$EXPORT$incRef)
(i32.load offset=8
(i32.add
(i32.shl
(local.get $0)
(i32.const 2)
)
(local.get $1)
)
(local.get $0)
)
)
)
Expand Down
Loading

0 comments on commit 618840f

Please sign in to comment.