summaryrefslogtreecommitdiff
path: root/test/dot_s/export_malloc_free.wast
blob: b645b9e8a7a5a09dd78bbfa3387c151821bb86a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(module
 (import "env" "memory" (memory $0 1))
 (table 0 anyfunc)
 (export "stackSave" (func $stackSave))
 (export "stackAlloc" (func $stackAlloc))
 (export "stackRestore" (func $stackRestore))
 (export "main" (func $main))
 (export "malloc" (func $malloc))
 (export "free" (func $free))
 (export "realloc" (func $realloc))
 (export "memalign" (func $memalign))
 (func $main (; 0 ;) (result i32)
  (i32.const 0)
 )
 (func $malloc (; 1 ;) (param $0 i32) (result i32)
  (i32.const 0)
 )
 (func $free (; 2 ;) (param $0 i32)
 )
 (func $realloc (; 3 ;) (param $0 i32) (param $1 i32) (result i32)
  (i32.const 0)
 )
 (func $memalign (; 4 ;) (param $0 i32) (param $1 i32) (result i32)
  (i32.const 0)
 )
 (func $not_a_malloc (; 5 ;) (param $0 i32) (param $1 i32) (result i32)
  (i32.const 0)
 )
 (func $stackSave (; 6 ;) (result i32)
  (i32.load offset=4
   (i32.const 0)
  )
 )
 (func $stackAlloc (; 7 ;) (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.sub
     (get_local $1)
     (get_local $0)
    )
    (i32.const -16)
   )
  )
  (get_local $1)
 )
 (func $stackRestore (; 8 ;) (param $0 i32)
  (i32.store offset=4
   (i32.const 0)
   (get_local $0)
  )
 )
)
;; METADATA: { "asmConsts": {},"staticBump": 12, "initializers": [] }