summaryrefslogtreecommitdiff
path: root/test/ctor-eval/imported-global-2.wast
blob: f1dfc682845c1ea588fdc844f57327c8811b8729 (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
(module
  ;; imports must not be used
  (import "env" "imported" (global $imported i32))

  (memory 256 256)

  (func $test1 (export "test1") (result i32)
    (local $temp i32)

    ;; this errors, and we never get to evalling the store after it
    (local.set $temp
      (global.get $imported)
    )

    (i32.store8
      (i32.const 13)
      (i32.const 115)
    )

    (local.get $temp)
  )

  (func $keepalive (export "keepalive") (result i32)
    (drop
      (i32.load
        (i32.const 13)
      )
    )
    (global.get $imported)
  )
)