summaryrefslogtreecommitdiff
path: root/test/lit/legacy-static-casts.wast
blob: 0cbd30a2dff8d02b042bb9672286cfce47ab5c83 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.

;; Check that the deprecated *_static instruction names are still parsed correctly.

;; RUN: wasm-opt %s -all -S -o - | filecheck %s

(module
  ;; CHECK:      (type $struct (struct ))
  (type $struct (struct))

  ;; CHECK:      (type $none_=>_none (func))

  ;; CHECK:      (func $test (type $none_=>_none)
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (ref.test $struct
  ;; CHECK-NEXT:    (ref.null none)
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (ref.cast null $struct
  ;; CHECK-NEXT:    (ref.null none)
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (ref.cast_nop $struct
  ;; CHECK-NEXT:    (ref.null none)
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (block $l1 (result (ref null $struct))
  ;; CHECK-NEXT:    (br_on_cast $l1 $struct
  ;; CHECK-NEXT:     (ref.null none)
  ;; CHECK-NEXT:    )
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT:  (drop
  ;; CHECK-NEXT:   (block $l2 (result (ref null $struct))
  ;; CHECK-NEXT:    (br_on_cast_fail $l2 $struct
  ;; CHECK-NEXT:     (ref.null none)
  ;; CHECK-NEXT:    )
  ;; CHECK-NEXT:   )
  ;; CHECK-NEXT:  )
  ;; CHECK-NEXT: )
  (func $test
    (drop
      (ref.test_static $struct
        (ref.null none)
      )
    )
    (drop
      (ref.cast_static $struct
        (ref.null none)
      )
    )
    (drop
      (ref.cast_nop_static $struct
        (ref.null none)
      )
    )
    (drop
      (block $l1 (result (ref null $struct))
        (br_on_cast_static $l1 $struct
          (ref.null none)
        )
      )
    )
    (drop
      (block $l2 (result (ref null $struct))
        (br_on_cast_static_fail $l2 $struct
          (ref.null none)
        )
      )
    )
  )
)