summaryrefslogtreecommitdiff
path: root/test/lld/recursive_safe_stack.wat.out
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-12-08 20:50:25 -0600
committerGitHub <noreply@github.com>2019-12-08 20:50:25 -0600
commit42b61e3c2e7851ed001bf26a7e1afab21d0cb38d (patch)
treeb86a0a10ec9ea1d4351e4500ff84f987894aaf8e /test/lld/recursive_safe_stack.wat.out
parentb232033385b025ba276423613fb67f644c0596ce (diff)
downloadbinaryen-42b61e3c2e7851ed001bf26a7e1afab21d0cb38d.tar.gz
binaryen-42b61e3c2e7851ed001bf26a7e1afab21d0cb38d.tar.bz2
binaryen-42b61e3c2e7851ed001bf26a7e1afab21d0cb38d.zip
Use wat over wast for text format filenames (#2518)
Diffstat (limited to 'test/lld/recursive_safe_stack.wat.out')
-rw-r--r--test/lld/recursive_safe_stack.wat.out244
1 files changed, 244 insertions, 0 deletions
diff --git a/test/lld/recursive_safe_stack.wat.out b/test/lld/recursive_safe_stack.wat.out
new file mode 100644
index 000000000..7253a28fb
--- /dev/null
+++ b/test/lld/recursive_safe_stack.wat.out
@@ -0,0 +1,244 @@
+(module
+ (type $0 (func (param i32 i32) (result i32)))
+ (type $1 (func))
+ (type $2 (func (result i32)))
+ (type $FUNCSIG$v (func))
+ (import "env" "printf" (func $printf (param i32 i32) (result i32)))
+ (import "env" "__handle_stack_overflow" (func $__handle_stack_overflow))
+ (memory $0 2)
+ (data (i32.const 568) "%d:%d\n\00Result: %d\n\00")
+ (table $0 1 1 funcref)
+ (global $global$0 (mut i32) (i32.const 66128))
+ (global $global$1 i32 (i32.const 66128))
+ (global $global$2 i32 (i32.const 587))
+ (global $__stack_limit (mut i32) (i32.const 0))
+ (export "memory" (memory $0))
+ (export "__wasm_call_ctors" (func $__wasm_call_ctors))
+ (export "__heap_base" (global $global$1))
+ (export "__data_end" (global $global$2))
+ (export "main" (func $main))
+ (export "__set_stack_limit" (func $__set_stack_limit))
+ (export "stackSave" (func $stackSave))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackRestore" (func $stackRestore))
+ (export "__growWasmMemory" (func $__growWasmMemory))
+ (func $__wasm_call_ctors (; 2 ;) (type $1)
+ (nop)
+ )
+ (func $foo (; 3 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (local $2 i32)
+ (local $3 i32)
+ (local $4 i32)
+ (block
+ (if
+ (i32.lt_u
+ (local.tee $3
+ (local.tee $2
+ (i32.sub
+ (global.get $global$0)
+ (i32.const 16)
+ )
+ )
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $3)
+ )
+ )
+ (i32.store offset=4
+ (local.get $2)
+ (local.get $1)
+ )
+ (i32.store
+ (local.get $2)
+ (local.get $0)
+ )
+ (drop
+ (call $printf
+ (i32.const 568)
+ (local.get $2)
+ )
+ )
+ (block
+ (if
+ (i32.lt_u
+ (local.tee $4
+ (i32.add
+ (local.get $2)
+ (i32.const 16)
+ )
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $4)
+ )
+ )
+ (i32.add
+ (local.get $1)
+ (local.get $0)
+ )
+ )
+ (func $__original_main (; 4 ;) (type $2) (result i32)
+ (local $0 i32)
+ (local $1 i32)
+ (local $2 i32)
+ (block
+ (if
+ (i32.lt_u
+ (local.tee $1
+ (local.tee $0
+ (i32.sub
+ (global.get $global$0)
+ (i32.const 16)
+ )
+ )
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $1)
+ )
+ )
+ (i32.store
+ (local.get $0)
+ (call $foo
+ (i32.const 1)
+ (i32.const 2)
+ )
+ )
+ (drop
+ (call $printf
+ (i32.const 575)
+ (local.get $0)
+ )
+ )
+ (block
+ (if
+ (i32.lt_u
+ (local.tee $2
+ (i32.add
+ (local.get $0)
+ (i32.const 16)
+ )
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $2)
+ )
+ )
+ (i32.const 0)
+ )
+ (func $main (; 5 ;) (type $0) (param $0 i32) (param $1 i32) (result i32)
+ (call $__original_main)
+ )
+ (func $__set_stack_limit (; 6 ;) (param $0 i32)
+ (global.set $__stack_limit
+ (local.get $0)
+ )
+ )
+ (func $stackSave (; 7 ;) (result i32)
+ (global.get $global$0)
+ )
+ (func $stackAlloc (; 8 ;) (param $0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (block
+ (if
+ (i32.lt_u
+ (local.tee $2
+ (local.tee $1
+ (i32.and
+ (i32.sub
+ (global.get $global$0)
+ (local.get $0)
+ )
+ (i32.const -16)
+ )
+ )
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $2)
+ )
+ )
+ (local.get $1)
+ )
+ (func $stackRestore (; 9 ;) (param $0 i32)
+ (local $1 i32)
+ (if
+ (i32.lt_u
+ (local.tee $1
+ (local.get $0)
+ )
+ (global.get $__stack_limit)
+ )
+ (call $__handle_stack_overflow)
+ )
+ (global.set $global$0
+ (local.get $1)
+ )
+ )
+ (func $__growWasmMemory (; 10 ;) (param $newSize i32) (result i32)
+ (memory.grow
+ (local.get $newSize)
+ )
+ )
+)
+(;
+--BEGIN METADATA --
+{
+ "staticBump": 19,
+ "tableSize": 1,
+ "initializers": [
+ "__wasm_call_ctors"
+ ],
+ "declares": [
+ "printf",
+ "__handle_stack_overflow"
+ ],
+ "externs": [
+ ],
+ "implementedFunctions": [
+ "___wasm_call_ctors",
+ "_main",
+ "___set_stack_limit",
+ "_stackSave",
+ "_stackAlloc",
+ "_stackRestore",
+ "___growWasmMemory"
+ ],
+ "exports": [
+ "__wasm_call_ctors",
+ "main",
+ "__set_stack_limit",
+ "stackSave",
+ "stackAlloc",
+ "stackRestore",
+ "__growWasmMemory"
+ ],
+ "namedGlobals": {
+ "__heap_base" : "66128",
+ "__data_end" : "587"
+ },
+ "invokeFuncs": [
+ ],
+ "features": [
+ ],
+ "mainReadsParams": 0
+}
+-- END METADATA --
+;)