regress-648079.js 16.9 KB
Newer Older
1 2 3 4 5 6 7 8 9
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Flags: --expose-wasm

load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");

10 11 12 13
// Non-standard opcodes.
let kSig_s_v = makeSig([], [kWasmS128]);
let kExprS128LoadMem = 0xc0;

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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
(function() {
"use asm";
var builder = new WasmModuleBuilder();
builder.addFunction("regression_648079", kSig_s_v)
  .addBody([
    // locals:
    0x00,
    // body:
    kExprI64RemU,
    kExprI64Ctz,
    kExprI64LeU,
    kExprUnreachable,
    kExprUnreachable,
    kExprUnreachable,
    kExprUnreachable,
    kExprI64Ctz,
    kExprI64Ne,
    kExprI64ShrS,
    kExprI64GtS,
    kExprI64RemU,
    kExprUnreachable,
    kExprI64RemU,
    kExprI32Eqz,
    kExprI64LeU,
    kExprDrop,
    kExprF32Add,
    kExprI64Ior,
    kExprF32CopySign,
    kExprI64Ne,
    kExprI64GeS,
    kExprUnreachable,
    kExprF32Trunc,
    kExprF32Trunc,
    kExprUnreachable,
    kExprIf, 10,   // @32
      kExprBlock, 00,   // @34
        kExprBr,   // depth=109
        kExprI64Shl,
        kExprI64LeU,
        kExprI64GeS,
        kExprI64Clz,
        kExprF32Min,
        kExprF32Eq,
        kExprF32Trunc,
        kExprF32Trunc,
        kExprF32Trunc,
        kExprUnreachable,
        kExprI32Const,
        kExprUnreachable,
        kExprBr,   // depth=101
        kExprF32Div,
        kExprI64GtU,
        kExprI64GeS,
        kExprI64Clz,
        kExprSelect,
        kExprI64GtS,
        kExprI64RemU,
        kExprI64LeU,
        kExprI64Shl,
        kExprI64Ctz,
        kExprLoop, 01,   // @63 i32
        kExprElse,   // @65
          kExprI64LeU,
          kExprI64RemU,
          kExprI64Ne,
          kExprI64GeS,
          kExprI32Const,
          kExprI64GtS,
          kExprI64LoadMem32U,
          kExprI64Clz,
          kExprI64Shl,
          kExprI64Ne,
          kExprI64ShrS,
          kExprI64GtS,
          kExprI64DivU,
          kExprI64Ne,
          kExprI64GtS,
          kExprI64Ne,
          kExprI64Popcnt,
          kExprI64DivU,
          kExprI64DivU,
          kExprSelect,
          kExprI64Ctz,
          kExprI64Popcnt,
          kExprI64RemU,
          kExprI64Clz,
          kExprF64Sub,
          kExprF32Trunc,
          kExprF32Trunc,
          kExprI64RemU,
          kExprI64Ctz,
          kExprI64LeU,
          kExprUnreachable,
          kExprUnreachable,
          kExprUnreachable,
          kExprBrIf,   // depth=116
          kExprF32Min,
          kExprI64GtU,
          kExprBlock, 01,   // @107 i32
            kExprTeeLocal,
            kExprBlock, 01,   // @111 i32
              kExprBlock, 01,   // @113 i32
                kExprBlock, 01,   // @115 i32
                  kExprBlock, 01,   // @117 i32
                    kExprBlock, 01,   // @119 i32
                      kExprBlock, 01,   // @121 i32
                        kExprBlock, 01,   // @123 i32
                          kExprBlock, 88,   // @125
                            kExprF32Trunc,
                            kExprF32Trunc,
                            kExprF32Trunc,
                            kExprUnreachable,
                            kExprLoop, 40,   // @131
                              kExprUnreachable,
                              kExprUnreachable,
                              kExprI32Add,
                              kExprBlock, 05,   // @136
                                kExprUnreachable,
                                kExprIf, 02,   // @139 i64
                                  kExprBlock, 01,   // @141 i32
                                    kExprBrIf,   // depth=16
                                    kExprLoop, 00,   // @145
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprReturn,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprI64LoadMem16U,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprNop,
                                      kExprBr,   // depth=1
                                    kExprElse,   // @164
                                      kExprF32Trunc,
                                      kExprI32Add,
                                      kExprCallIndirect,   // sig #1
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprUnreachable,
                                      kExprBlock, 00,   // @172
                                        kExprI64RemU,
                                        kExprI64Ctz,
                                        kExprI64LeU,
                                        kExprUnreachable,
                                        kExprUnreachable,
                                        kExprUnreachable,
                                        kExprUnreachable,
                                        kExprUnreachable,
                                        kExprDrop,
                                        kExprI64Popcnt,
                                        kExprF32Min,
                                        kExprUnreachable,
                                        kExprF64Sub,
                                        kExprI32Const,
                                        kExprUnreachable,
                                        kExprGetLocal,
                                        kExprI64LoadMem32U,
                                        kExprUnreachable,
                                        kExprI64RemU,
                                        kExprI32Eqz,
                                        kExprI64LeU,
                                        kExprDrop,
                                        kExprF32Add,
                                        kExprI64Ior,
                                        kExprF32CopySign,
                                        kExprI64Ne,
                                        kExprI64GeS,
                                        kExprUnreachable,
                                        kExprF32Trunc,
                                        kExprF32Trunc,
                                        kExprUnreachable,
                                        kExprIf, 10,   // @216
                                          kExprBlock, 00,   // @218
                                            kExprBr,   // depth=109
                                            kExprI64Shl,
                                            kExprI64LeU,
                                            kExprI64GeS,
                                            kExprI64Clz,
                                            kExprF32Min,
                                            kExprF32Eq,
                                            kExprF32Trunc,
                                            kExprF32Trunc,
                                            kExprF32Trunc,
                                            kExprUnreachable,
                                            kExprF64Min,
                                            kExprI32Const,
                                            kExprBr,   // depth=101
                                            kExprF32Div,
                                            kExprI64GtU,
                                            kExprI64GeS,
                                            kExprI64Clz,
                                            kExprI64Popcnt,
                                            kExprF64Lt,
                                            kExprF32Trunc,
                                            kExprF32Trunc,
                                            kExprF32Trunc,
                                            kExprUnreachable,
                                            kExprLoop, 01,   // @247 i32
                                            kExprElse,   // @249
                                              kExprI64LeU,
                                              kExprI64RemU,
                                              kExprI64Ne,
                                              kExprI64GeS,
                                              kExprI32Const,
                                              kExprBlock, 01,   // @256 i32
                                                kExprBlock, 01,   // @258 i32
                                                  kExprBlock, 01,   // @260 i32
                                                    kExprBlock, 01,   // @262 i32
                                                      kExprBlock, 01,   // @264 i32
                                                        kExprF32Ge,
                                                        kExprF32Trunc,
                                                        kExprF32Trunc,
                                                        kExprF32Trunc,
                                                        kExprUnreachable,
                                                        kExprLoop, 40,   // @271
                                                          kExprUnreachable,
                                                          kExprUnreachable,
                                                          kExprI32Add,
                                                          kExprBlock, 01,   // @276 i32
                                                            kExprUnreachable,
                                                            kExprIf, 02,   // @279 i64
                                                              kExprBlock, 00,   // @281
                                                                kExprBrIf,   // depth=16
                                                                kExprLoop, 00,   // @285
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprReturn,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprI64LoadMem16U,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprNop,
                                                                  kExprBr,   // depth=1
                                                                kExprElse,   // @304
                                                                  kExprF32Trunc,
                                                                  kExprI32Add,
                                                                  kExprCallIndirect,   // sig #1
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprUnreachable,
                                                                  kExprBlock, 00,   // @312
                                                                    kExprI64RemU,
                                                                    kExprI64Ctz,
                                                                    kExprI64LeU,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprDrop,
                                                                    kExprI64Popcnt,
                                                                    kExprF32Min,
                                                                    kExprUnreachable,
                                                                    kExprF64Sub,
                                                                    kExprI32Const,
                                                                    kExprUnreachable,
                                                                    kExprGetLocal,
                                                                    kExprI64LoadMem32U,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprNop,
                                                                    kExprBr,   // depth=1
                                                                  kExprElse,   // @348
                                                                    kExprF32Trunc,
                                                                    kExprI32Add,
                                                                    kExprCallIndirect,   // sig #1
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprBlock, 00,   // @356
                                                                    kExprI64RemU,
                                                                    kExprI64Ctz,
                                                                    kExprI64LeU,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprUnreachable,
                                                                    kExprDrop,
                                                                    kExprI64Popcnt,
                                                                    kExprF32Min,
                                                                    kExprUnreachable,
                                                                    kExprF64Sub,
                                                                    kExprI32Const,
                                                                    kExprUnreachable,
                                                                    kExprGetLocal,
                                                                    kExprI64LoadMem32U,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF32Trunc,
                                                                    kExprF32Trunc,
                                                                    kExprF32Trunc,
                                                                    kExprUnreachable,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
                                                                    kExprF64Min,
            ])
            .exportFunc();
assertThrows(function() { builder.instantiate(); });
})();