summaryrefslogtreecommitdiff
path: root/scripts/bin/ex.wat
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-11-12 21:36:20 -0500
committerMicha White <botahamec@outlook.com>2023-11-12 21:36:20 -0500
commit82a737798b5694e353971a00f46d117743d2a03e (patch)
tree0a7ad7cd5e855ac33eb727380453cee21255ecb0 /scripts/bin/ex.wat
parentec1f71ad69e9a286f6c68f51b3a3ec2a02dd14bb (diff)
Create a benchmark for scripts
Diffstat (limited to 'scripts/bin/ex.wat')
-rw-r--r--scripts/bin/ex.wat29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/bin/ex.wat b/scripts/bin/ex.wat
new file mode 100644
index 0000000..af461bd
--- /dev/null
+++ b/scripts/bin/ex.wat
@@ -0,0 +1,29 @@
+(module
+ (import "alligator" "abs" (func $abs (param i32) (result i32)))
+ (func $add1
+ (local $i i32)
+ (loop $myloop
+ local.get $i
+ i32.const 1
+ i32.add
+ local.set $i
+
+ local.get $i
+ call $abs
+
+ local.get $i
+ i32.const 40
+ i32.lt_s
+ br_if $myloop
+
+ drop
+ )
+ )
+ (func $add2 nop)
+ (export "begin" (func $add2))
+ (export "update" (func $add1))
+ (memory (;0;) 16)
+ (export "memory" (memory 0))
+ (global $base i32 (i32.const 1))
+ (export "__heap_base" (global $base))
+)