summaryrefslogtreecommitdiff
path: root/test/roundtrip/fold-load-store64.txt
blob: 91e45a606e8770bb09f6debe19d010166919b235 (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
;;; TOOL: run-roundtrip
;;; ARGS: --stdout --fold-exprs --enable-memory64
(module
  (memory i64 1)
  (func $fold-load
    i64.const 1
    i32.load
    drop
    i64.const 2
    i32.load
    drop)

  (func $fold-store
    i64.const 1
    i64.load
    f32.const 2
    f32.store)

  (func $fold-current-memory (result i32)
    current_memory
    i64.const 1
    i64.add
    drop
    i32.const 2)

  (func $fold-grow-memory (result i32)
    i64.const 1
    i64.const 2
    grow_memory
    i64.lt_s))
(;; STDOUT ;;;
(module
  (type (;0;) (func))
  (type (;1;) (func (result i32)))
  (func (;0;) (type 0)
    (drop
      (i32.load
        (i64.const 1)))
    (drop
      (i32.load
        (i64.const 2))))
  (func (;1;) (type 0)
    (f32.store
      (i64.load
        (i64.const 1))
      (f32.const 0x1p+1 (;=2;))))
  (func (;2;) (type 1) (result i32)
    (drop
      (i64.add
        (memory.size)
        (i64.const 1)))
    (i32.const 2))
  (func (;3;) (type 1) (result i32)
    (i64.lt_s
      (i64.const 1)
      (memory.grow
        (i64.const 2))))
  (memory (;0;) i64 1))
;;; STDOUT ;;)