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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
;; NOTE: Assertions have been generated by update_lit_checks.py --output=fuzz-exec and should not be edited.
;; Check that allocation and casting instructions with and without RTTs can be
;; mixed correctly.
;; RUN: wasm-opt %s -all --fuzz-exec-before -q --structural -o /dev/null 2>&1 \
;; RUN: | filecheck %s --check-prefix=EQREC
;; RUN: wasm-opt %s -all --fuzz-exec-before -q --nominal -o /dev/null 2>&1 \
;; RUN: | filecheck %s --check-prefix=NOMNL
(module
(type $struct (struct_subtype i32 data))
(type $sub-struct (struct_subtype i32 i32 $struct))
(import "fuzzing-support" "log-i32" (func $log (param i32)))
(global $sub-rtt (rtt 1 $sub-struct)
(rtt.sub $sub-struct
(rtt.canon $struct)
)
)
(func $make-sub-struct-canon (result (ref $struct))
(struct.new_default_with_rtt $sub-struct
(rtt.canon $sub-struct)
)
)
(func $make-sub-struct-sub (result (ref $struct))
(struct.new_default_with_rtt $sub-struct
(global.get $sub-rtt)
)
)
(func $make-sub-struct-static (result (ref $struct))
(struct.new_default $sub-struct)
)
;; EQREC: [fuzz-exec] calling canon-canon
;; EQREC-NEXT: [LoggingExternalInterface logging 1]
;; NOMNL: [fuzz-exec] calling canon-canon
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "canon-canon"
(call $log
(ref.test
(call $make-sub-struct-canon)
(rtt.canon $sub-struct)
)
)
)
;; EQREC: [fuzz-exec] calling canon-sub
;; EQREC-NEXT: [LoggingExternalInterface logging 0]
;; NOMNL: [fuzz-exec] calling canon-sub
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "canon-sub"
(call $log
(ref.test
(call $make-sub-struct-canon)
(global.get $sub-rtt)
)
)
)
;; EQREC: [fuzz-exec] calling canon-static
;; EQREC-NEXT: [LoggingExternalInterface logging 1]
;; NOMNL: [fuzz-exec] calling canon-static
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "canon-static"
(call $log
(ref.test_static $sub-struct
(call $make-sub-struct-canon)
)
)
)
;; EQREC: [fuzz-exec] calling sub-canon
;; EQREC-NEXT: [LoggingExternalInterface logging 0]
;; NOMNL: [fuzz-exec] calling sub-canon
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "sub-canon"
(call $log
(ref.test
(call $make-sub-struct-sub)
(rtt.canon $sub-struct)
)
)
)
;; EQREC: [fuzz-exec] calling sub-sub
;; EQREC-NEXT: [LoggingExternalInterface logging 1]
;; NOMNL: [fuzz-exec] calling sub-sub
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "sub-sub"
(call $log
(ref.test
(call $make-sub-struct-sub)
(global.get $sub-rtt)
)
)
)
;; EQREC: [fuzz-exec] calling sub-static
;; EQREC-NEXT: [LoggingExternalInterface logging 0]
;; NOMNL: [fuzz-exec] calling sub-static
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "sub-static"
(call $log
(ref.test_static $sub-struct
(call $make-sub-struct-sub)
)
)
)
;; EQREC: [fuzz-exec] calling static-canon
;; EQREC-NEXT: [LoggingExternalInterface logging 1]
;; NOMNL: [fuzz-exec] calling static-canon
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "static-canon"
(call $log
(ref.test
(call $make-sub-struct-static)
(rtt.canon $sub-struct)
)
)
)
;; EQREC: [fuzz-exec] calling static-sub
;; EQREC-NEXT: [LoggingExternalInterface logging 0]
;; NOMNL: [fuzz-exec] calling static-sub
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "static-sub"
(call $log
(ref.test
(call $make-sub-struct-static)
(global.get $sub-rtt)
)
)
)
;; EQREC: [fuzz-exec] calling static-static
;; EQREC-NEXT: [LoggingExternalInterface logging 1]
;; NOMNL: [fuzz-exec] calling static-static
;; NOMNL-NEXT: [LoggingExternalInterface logging 1]
(func "static-static"
(call $log
(ref.test_static $sub-struct
(call $make-sub-struct-static)
)
)
)
)
|