summaryrefslogtreecommitdiff
path: root/test/dot_s/function-data-sections.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/dot_s/function-data-sections.wast')
-rw-r--r--test/dot_s/function-data-sections.wast36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/dot_s/function-data-sections.wast b/test/dot_s/function-data-sections.wast
index 690d9e56c..64a7a67d4 100644
--- a/test/dot_s/function-data-sections.wast
+++ b/test/dot_s/function-data-sections.wast
@@ -4,6 +4,9 @@
(data (i32.const 12) "\00\00\00\00")
(data (i32.const 16) "\01\00\00\00")
(data (i32.const 20) "33\13@")
+ (export "stackSave" (func $stackSave))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackRestore" (func $stackRestore))
(export "foo" (func $foo))
(export "bar" (func $bar))
(export "qux" (func $qux))
@@ -23,5 +26,38 @@
)
)
)
+ (func $stackSave (result i32)
+ (i32.load offset=4
+ (i32.const 0)
+ )
+ )
+ (func $stackAlloc (param $0 i32) (result i32)
+ (local $1 i32)
+ (set_local $1
+ (i32.load offset=4
+ (i32.const 0)
+ )
+ )
+ (i32.store offset=4
+ (i32.const 0)
+ (i32.and
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (get_local $0)
+ )
+ (i32.const 15)
+ )
+ (i32.const -16)
+ )
+ )
+ (get_local $1)
+ )
+ (func $stackRestore (param $0 i32)
+ (i32.store offset=4
+ (i32.const 0)
+ (get_local $0)
+ )
+ )
)
;; METADATA: { "asmConsts": {},"staticBump": 24, "initializers": [] }