This commit is contained in:
2026-07-12 12:33:46 -06:00
parent fdf3064665
commit 4522e455dd
6 changed files with 128 additions and 29 deletions
+22 -2
View File
@@ -1,19 +1,39 @@
(module
(type (sub (struct (field (mut i32)))))
(func
(param)
(result i32)
(local i32 i32 i32 i32 i32)
(result (ref eq))
(local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq))
(i32.const 3)
ref.i31
(ref.cast (ref i31))
i31.get_s
(i32.const 4)
ref.i31
(ref.cast (ref i31))
i31.get_s
i32.mul
ref.i31
(local.set 0)
(i32.const 2)
ref.i31
(ref.cast (ref i31))
i31.get_s
(i32.const 5)
ref.i31
(ref.cast (ref i31))
i31.get_s
i32.mul
ref.i31
(local.set 1)
(local.get 0)
(ref.cast (ref i31))
i31.get_s
(local.get 1)
(ref.cast (ref i31))
i31.get_s
i32.add
ref.i31
(local.set 2)
(local.get 2))
(export "main" (func 0)))
+6 -4
View File
@@ -1,11 +1,13 @@
(module
(type (sub (struct (field (mut i32)))))
(func
(param)
(result i32)
(local i32 i32 i32 i32 i32)
(result (ref eq))
(local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq))
(i32.const 0)
ref.i31
(if
(result i32)
(then (i32.const 777))
(else (i32.const 555))))
(then (i32.const 777) ref.i31)
(else (i32.const 555) ref.i31)))
(export "main" (func 0)))
+6 -4
View File
@@ -1,11 +1,13 @@
(module
(type (sub (struct (field (mut i32)))))
(func
(param)
(result i32)
(local i32 i32 i32 i32 i32)
(result (ref eq))
(local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq))
(i32.const 1)
ref.i31
(if
(result i32)
(then (i32.const 777))
(else (i32.const 555))))
(then (i32.const 777) ref.i31)
(else (i32.const 555) ref.i31)))
(export "main" (func 0)))