blob: e0a580ae1b34ec55f0190e6b01a95dfa19d35e30 (
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
|
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;; RUN: wasm-opt %s --optimize-instructions --traps-never-happen --enable-gc-nn-locals -all -S -o - \
;; RUN: | filecheck %s
(module
;; CHECK: (func $set-of-as-non-null
;; CHECK-NEXT: (local $x anyref)
;; CHECK-NEXT: (local.set $x
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.tee $x
;; CHECK-NEXT: (ref.as_non_null
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $set-of-as-non-null
(local $x anyref)
;; As we ignore such traps, we can in principle remove the ref.as here.
;; However, as we allow non-nullable locals, we should not do that - if we
;; did it it might prevent specializing the local type later.
(local.set $x
(ref.as_non_null
(local.get $x)
)
)
;; The same for a tee.
(drop
(local.tee $x
(ref.as_non_null
(local.get $x)
)
)
)
)
)
|