|
| 1 | +(module definition binary |
| 2 | + "\00\61\73\6d\01\00\00\00\01\c8\80\80\80\00\0e\60" |
| 3 | + "\00\01\7f\60\00\01\7e\60\00\01\7d\60\00\01\7c\60" |
| 4 | + "\01\7f\01\7f\60\01\7e\01\7e\60\01\7d\01\7d\60\01" |
| 5 | + "\7c\01\7c\60\02\7d\7f\01\7f\60\02\7f\7e\01\7e\60" |
| 6 | + "\02\7c\7d\01\7d\60\02\7e\7c\01\7c\60\02\7e\7e\01" |
| 7 | + "\7e\60\01\7e\01\7f\03\9d\80\80\80\00\1c\00\01\02" |
| 8 | + "\03\04\05\06\07\08\09\0a\0b\00\01\02\03\00\01\02" |
| 9 | + "\03\00\01\02\03\0c\05\0d\0d\07\d8\81\80\80\00\10" |
| 10 | + "\08\74\79\70\65\2d\69\33\32\00\0c\08\74\79\70\65" |
| 11 | + "\2d\69\36\34\00\0d\08\74\79\70\65\2d\66\33\32\00" |
| 12 | + "\0e\08\74\79\70\65\2d\66\36\34\00\0f\0e\74\79\70" |
| 13 | + "\65\2d\66\69\72\73\74\2d\69\33\32\00\10\0e\74\79" |
| 14 | + "\70\65\2d\66\69\72\73\74\2d\69\36\34\00\11\0e\74" |
| 15 | + "\79\70\65\2d\66\69\72\73\74\2d\66\33\32\00\12\0e" |
| 16 | + "\74\79\70\65\2d\66\69\72\73\74\2d\66\36\34\00\13" |
| 17 | + "\0f\74\79\70\65\2d\73\65\63\6f\6e\64\2d\69\33\32" |
| 18 | + "\00\14\0f\74\79\70\65\2d\73\65\63\6f\6e\64\2d\69" |
| 19 | + "\36\34\00\15\0f\74\79\70\65\2d\73\65\63\6f\6e\64" |
| 20 | + "\2d\66\33\32\00\16\0f\74\79\70\65\2d\73\65\63\6f" |
| 21 | + "\6e\64\2d\66\36\34\00\17\07\66\61\63\2d\61\63\63" |
| 22 | + "\00\18\05\63\6f\75\6e\74\00\19\04\65\76\65\6e\00" |
| 23 | + "\1a\03\6f\64\64\00\1b\0a\80\83\80\80\00\1c\85\80" |
| 24 | + "\80\80\00\00\41\b2\02\0b\85\80\80\80\00\00\42\e4" |
| 25 | + "\02\0b\87\80\80\80\00\00\43\00\20\73\45\0b\8b\80" |
| 26 | + "\80\80\00\00\44\00\00\00\00\00\c8\ae\40\0b\84\80" |
| 27 | + "\80\80\00\00\20\00\0b\84\80\80\80\00\00\20\00\0b" |
| 28 | + "\84\80\80\80\00\00\20\00\0b\84\80\80\80\00\00\20" |
| 29 | + "\00\0b\84\80\80\80\00\00\20\01\0b\84\80\80\80\00" |
| 30 | + "\00\20\01\0b\84\80\80\80\00\00\20\01\0b\84\80\80" |
| 31 | + "\80\00\00\20\01\0b\84\80\80\80\00\00\12\00\0b\84" |
| 32 | + "\80\80\80\00\00\12\01\0b\84\80\80\80\00\00\12\02" |
| 33 | + "\0b\84\80\80\80\00\00\12\03\0b\86\80\80\80\00\00" |
| 34 | + "\41\20\12\04\0b\87\80\80\80\00\00\42\c0\00\12\05" |
| 35 | + "\0b\89\80\80\80\00\00\43\c3\f5\a8\3f\12\06\0b\8d" |
| 36 | + "\80\80\80\00\00\44\3d\0a\d7\a3\70\3d\fa\3f\12\07" |
| 37 | + "\0b\8b\80\80\80\00\00\43\66\66\00\42\41\20\12\08" |
| 38 | + "\0b\89\80\80\80\00\00\41\20\42\c0\00\12\09\0b\92" |
| 39 | + "\80\80\80\00\00\44\00\00\00\00\00\00\50\40\43\00" |
| 40 | + "\00\00\42\12\0a\0b\90\80\80\80\00\00\42\c0\00\44" |
| 41 | + "\66\66\66\66\66\06\50\40\12\0b\0b\97\80\80\80\00" |
| 42 | + "\00\20\00\50\04\7e\20\01\05\20\00\42\01\7d\20\00" |
| 43 | + "\20\01\7e\12\18\0b\0b\92\80\80\80\00\00\20\00\50" |
| 44 | + "\04\7e\20\00\05\20\00\42\01\7d\12\19\0b\0b\92\80" |
| 45 | + "\80\80\00\00\20\00\50\04\7f\41\2c\05\20\00\42\01" |
| 46 | + "\7d\12\1b\0b\0b\93\80\80\80\00\00\20\00\50\04\7f" |
| 47 | + "\41\e3\00\05\20\00\42\01\7d\12\1a\0b\0b" |
| 48 | +) |
| 49 | +(module instance) |
| 50 | +(assert_return (invoke "type-i32") (i32.const 0x132)) |
| 51 | +(assert_return (invoke "type-i64") (i64.const 0x164)) |
| 52 | +;; (assert_return (invoke "type-f32") (f32.const 0x1.e64p+11)) |
| 53 | +;; (assert_return (invoke "type-f64") (f64.const 0x1.ec8p+11)) |
| 54 | +(assert_return (invoke "type-first-i32") (i32.const 0x20)) |
| 55 | +(assert_return (invoke "type-first-i64") (i64.const 0x40)) |
| 56 | +;; (assert_return (invoke "type-first-f32") (f32.const 0x1.51eb_86p+0)) |
| 57 | +;; (assert_return (invoke "type-first-f64") (f64.const 0x1.a3d7_0a3d_70a3_dp+0)) |
| 58 | +(assert_return (invoke "type-second-i32") (i32.const 0x20)) |
| 59 | +(assert_return (invoke "type-second-i64") (i64.const 0x40)) |
| 60 | +(assert_return (invoke "type-second-f32") (f32.const 0x1p+5)) |
| 61 | +;; (assert_return (invoke "type-second-f64") (f64.const 0x1.0066_6666_6666_6p+6)) |
| 62 | +(assert_return |
| 63 | + (invoke "fac-acc" (i64.const 0x0) (i64.const 0x1)) |
| 64 | + (i64.const 0x1) |
| 65 | +) |
| 66 | +(assert_return |
| 67 | + (invoke "fac-acc" (i64.const 0x1) (i64.const 0x1)) |
| 68 | + (i64.const 0x1) |
| 69 | +) |
| 70 | +(assert_return |
| 71 | + (invoke "fac-acc" (i64.const 0x5) (i64.const 0x1)) |
| 72 | + (i64.const 0x78) |
| 73 | +) |
| 74 | +(assert_return (invoke "count" (i64.const 0x0)) (i64.const 0x0)) |
| 75 | +(assert_return (invoke "count" (i64.const 0x3e8)) (i64.const 0x0)) |
| 76 | +;; See `count.wat` for why this is commented out |
| 77 | +;; (assert_return (invoke "count" (i64.const 0xf_4240)) (i64.const 0x0)) |
| 78 | +(assert_return (invoke "even" (i64.const 0x0)) (i32.const 0x2c)) |
| 79 | +(assert_return (invoke "even" (i64.const 0x1)) (i32.const 0x63)) |
| 80 | +(assert_return (invoke "even" (i64.const 0x64)) (i32.const 0x2c)) |
| 81 | +(assert_return (invoke "even" (i64.const 0x4d)) (i32.const 0x63)) |
| 82 | +;; See `return_call.wat` for why these are commented out |
| 83 | +;; (assert_return (invoke "even" (i64.const 0xf_4240)) (i32.const 0x2c)) |
| 84 | +;; (assert_return (invoke "even" (i64.const 0xf_4241)) (i32.const 0x63)) |
| 85 | +(assert_return (invoke "odd" (i64.const 0x0)) (i32.const 0x63)) |
| 86 | +(assert_return (invoke "odd" (i64.const 0x1)) (i32.const 0x2c)) |
| 87 | +(assert_return (invoke "odd" (i64.const 0xc8)) (i32.const 0x63)) |
| 88 | +(assert_return (invoke "odd" (i64.const 0x4d)) (i32.const 0x2c)) |
| 89 | +;; (assert_return (invoke "odd" (i64.const 0xf_4240)) (i32.const 0x63)) |
| 90 | +;; (assert_return (invoke "odd" (i64.const 0xf_423f)) (i32.const 0x2c)) |
| 91 | +(assert_invalid |
| 92 | + (module binary |
| 93 | + "\00\61\73\6d\01\00\00\00\01\88\80\80\80\00\02\60" |
| 94 | + "\00\01\7f\60\00\00\03\83\80\80\80\00\02\00\01\0a" |
| 95 | + "\93\80\80\80\00\02\86\80\80\80\00\00\12\01\41\00" |
| 96 | + "\0b\82\80\80\80\00\00\0b" |
| 97 | + ) |
| 98 | + "type mismatch" |
| 99 | +) |
| 100 | +(assert_invalid |
| 101 | + (module binary |
| 102 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 103 | + "\00\01\7f\60\00\01\7e\03\83\80\80\80\00\02\00\01" |
| 104 | + "\0a\95\80\80\80\00\02\86\80\80\80\00\00\12\01\41" |
| 105 | + "\00\0b\84\80\80\80\00\00\42\01\0b" |
| 106 | + ) |
| 107 | + "type mismatch" |
| 108 | +) |
| 109 | +(assert_invalid |
| 110 | + (module binary |
| 111 | + "\00\61\73\6d\01\00\00\00\01\88\80\80\80\00\02\60" |
| 112 | + "\00\00\60\01\7f\00\03\83\80\80\80\00\02\00\01\0a" |
| 113 | + "\91\80\80\80\00\02\84\80\80\80\00\00\12\01\0b\82" |
| 114 | + "\80\80\80\00\00\0b" |
| 115 | + ) |
| 116 | + "type mismatch" |
| 117 | +) |
| 118 | +(assert_invalid |
| 119 | + (module binary |
| 120 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 121 | + "\00\00\60\02\7c\7f\00\03\83\80\80\80\00\02\00\01" |
| 122 | + "\0a\91\80\80\80\00\02\84\80\80\80\00\00\12\01\0b" |
| 123 | + "\82\80\80\80\00\00\0b" |
| 124 | + ) |
| 125 | + "type mismatch" |
| 126 | +) |
| 127 | +(module definition binary |
| 128 | + "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60" |
| 129 | + "\00\00\03\83\80\80\80\00\02\00\00\0a\93\80\80\80" |
| 130 | + "\00\02\86\80\80\80\00\00\41\01\12\01\0b\82\80\80" |
| 131 | + "\80\00\00\0b" |
| 132 | +) |
| 133 | +(module instance) |
| 134 | +(module definition binary |
| 135 | + "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60" |
| 136 | + "\00\00\03\83\80\80\80\00\02\00\00\0a\9c\80\80\80" |
| 137 | + "\00\02\8f\80\80\80\00\00\44\00\00\00\00\00\00\00" |
| 138 | + "\40\41\01\12\01\0b\82\80\80\80\00\00\0b" |
| 139 | +) |
| 140 | +(module instance) |
| 141 | +(assert_invalid |
| 142 | + (module binary |
| 143 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 144 | + "\00\00\60\02\7f\7f\00\03\83\80\80\80\00\02\00\01" |
| 145 | + "\0a\94\80\80\80\00\02\87\80\80\80\00\00\01\41\01" |
| 146 | + "\12\01\0b\82\80\80\80\00\00\0b" |
| 147 | + ) |
| 148 | + "type mismatch" |
| 149 | +) |
| 150 | +(assert_invalid |
| 151 | + (module binary |
| 152 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 153 | + "\00\00\60\02\7f\7f\00\03\83\80\80\80\00\02\00\01" |
| 154 | + "\0a\94\80\80\80\00\02\87\80\80\80\00\00\41\01\01" |
| 155 | + "\12\01\0b\82\80\80\80\00\00\0b" |
| 156 | + ) |
| 157 | + "type mismatch" |
| 158 | +) |
| 159 | +(assert_invalid |
| 160 | + (module binary |
| 161 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 162 | + "\00\00\60\02\7f\7c\00\03\83\80\80\80\00\02\00\01" |
| 163 | + "\0a\9c\80\80\80\00\02\8f\80\80\80\00\00\44\00\00" |
| 164 | + "\00\00\00\00\f0\3f\41\01\12\01\0b\82\80\80\80\00" |
| 165 | + "\00\0b" |
| 166 | + ) |
| 167 | + "type mismatch" |
| 168 | +) |
| 169 | +(assert_invalid |
| 170 | + (module binary |
| 171 | + "\00\61\73\6d\01\00\00\00\01\89\80\80\80\00\02\60" |
| 172 | + "\00\00\60\02\7c\7f\00\03\83\80\80\80\00\02\00\01" |
| 173 | + "\0a\9c\80\80\80\00\02\8f\80\80\80\00\00\41\01\44" |
| 174 | + "\00\00\00\00\00\00\f0\3f\12\01\0b\82\80\80\80\00" |
| 175 | + "\00\0b" |
| 176 | + ) |
| 177 | + "type mismatch" |
| 178 | +) |
| 179 | +(assert_invalid |
| 180 | + (module binary |
| 181 | + "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60" |
| 182 | + "\00\00\03\82\80\80\80\00\01\00\0a\8a\80\80\80\00" |
| 183 | + "\01\84\80\80\80\00\00\12\01\0b" |
| 184 | + ) |
| 185 | + "unknown function" |
| 186 | +) |
| 187 | +(assert_invalid |
| 188 | + (module binary |
| 189 | + "\00\61\73\6d\01\00\00\00\01\84\80\80\80\00\01\60" |
| 190 | + "\00\00\03\82\80\80\80\00\01\00\0a\8e\80\80\80\00" |
| 191 | + "\01\88\80\80\80\00\00\12\94\98\db\e2\03\0b" |
| 192 | + ) |
| 193 | + "unknown function" |
| 194 | +) |
0 commit comments