chromium/v8/test/unittests/wasm/wasm-disassembler-unittest-mvp.wat.inc

;; expected = ";; This is a polyglot C++/WAT file.\n;; Comment lines are ignored and not expected in the disassembler output.\n(module\n  ;; Imports.\n  (global $env.imported_global (;0;) (import \"env\" \"imported_global\") i32)\n  (func $env.imported_function (;0;) (import \"env\" \"imported_function\"))\n  ;; Table and memory sections.\n  (table $table0 4 funcref)\n  (memory $memory0 0 1)\n  ;; Non-imported globals: mutable, non-mutable, exported.\n  (global $global1 (mut i32) (i32.const 0))\n  (global $global2 i32 (global.get $env.imported_global))\n  (global $exported_global (;3;) (export \"exported_global\") i64 (i64.const 0))\n  ;; Element section for table initialization.\n  (elem $elem0 (i32.const 0) (ref func) (ref.func $env.imported_function) (ref.func $func1) (ref.func $func1) (ref.func $func3))\n  ;; Instructions on globals, locals, parameters.\n  (func $func1 (param $var0 i32)\n    (local $var1 i64)\n    local.get $var0\n    local.tee $var0\n    local.set $var0\n    local.get $var1\n    local.tee $var1\n    local.set $var1\n    global.get $global1\n    global.set $global1\n  )\n  ;; i32 operations.\n  (func $func2 (result i32)\n    ;; Comparisons and constant literals.\n    i32.const 0\n    i32.eqz\n    i32.const 1\n    i32.eq\n    i32.const -1\n    i32.ne\n    i32.const 2147483647\n    i32.lt_s\n    i32.const -2147483648\n    i32.lt_u\n    i32.const 0\n    i32.gt_s\n    i32.const 0\n    i32.gt_u\n    i32.const 0\n    i32.le_s\n    i32.const 0\n    i32.le_u\n    i32.const 0\n    i32.ge_s\n    i32.const 0\n    i32.ge_u\n    ;; Bitcounting.\n    i32.clz\n    i32.ctz\n    i32.popcnt\n    ;; Arithmetic and logic.\n    i32.const 0\n    i32.add\n    i32.const 0\n    i32.sub\n    i32.const 0\n    i32.mul\n    i32.const 0\n    i32.div_s\n    i32.const 0\n    i32.div_u\n    i32.const 0\n    i32.rem_s\n    i32.const 0\n    i32.rem_u\n    i32.const 0\n    i32.and\n    i32.const 0\n    i32.or\n    i32.const 0\n    i32.xor\n    i32.const 0\n    i32.shl\n    i32.const 0\n    i32.shr_s\n    i32.const 0\n    i32.shr_u\n    i32.const 0\n    i32.rotl\n    i32.const 0\n    i32.rotr\n    drop\n    ;; Conversions.\n    i64.const 0\n    i32.wrap_i64\n    drop\n    f32.const 0.0\n    i32.trunc_f32_s\n    drop\n    f32.const 0.0\n    i32.trunc_f32_u\n    drop\n    f64.const 0.0\n    i32.trunc_f64_s\n    drop\n    f64.const 0.0\n    i32.trunc_f64_u\n    drop\n    f32.const 0.0\n    i32.reinterpret_f32\n    i32.extend8_s\n    i32.extend16_s\n  )\n  ;; i64 operations.\n  (func $func3 (result i64)\n    ;; Comparisons and constant literals.\n    i64.const 0\n    i64.eqz\n    drop\n    i64.const 1\n    i64.const -1\n    i64.eq\n    drop\n    i64.const -9223372036854775808\n    i64.const 9223372036854775807\n    i64.ne\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_u\n    drop\n    ;; Bitcounting.\n    i64.const 0\n    i64.clz\n    i64.ctz\n    i64.popcnt\n    ;; Arithmetic and logic.\n    i64.const 0\n    i64.add\n    i64.const 0\n    i64.sub\n    i64.const 0\n    i64.mul\n    i64.const 0\n    i64.div_s\n    i64.const 0\n    i64.div_u\n    i64.const 0\n    i64.rem_s\n    i64.const 0\n    i64.rem_u\n    i64.const 0\n    i64.and\n    i64.const 0\n    i64.or\n    i64.const 0\n    i64.xor\n    i64.const 0\n    i64.shl\n    i64.const 0\n    i64.shr_s\n    i64.const 0\n    i64.shr_u\n    i64.const 0\n    i64.rotl\n    i64.const 0\n    i64.rotr\n    drop\n    ;; Conversions.\n    i32.const 0\n    i64.extend_i32_s\n    drop\n    i32.const 0\n    i64.extend_i32_u\n    drop\n    f32.const 0.0\n    i64.trunc_f32_s\n    drop\n    f32.const 0.0\n    i64.trunc_f32_u\n    drop\n    f64.const 0.0\n    i64.trunc_f64_s\n    drop\n    f64.const 0.0\n    i64.trunc_f64_u\n    drop\n    f64.const 0.0\n    i64.reinterpret_f64\n    i64.extend8_s\n    i64.extend16_s\n    i64.extend32_s\n  )\n  ;; f32 operations.\n  (func $func4 (result f32)\n    ;; Comparisons and constant literals.\n    f32.const 0.0\n    f32.const -0.0\n    f32.eq\n    drop\n    f32.const 1\n    f32.const -1\n    f32.ne\n    drop\n    f32.const inf\n    f32.const -inf\n    f32.lt\n    drop\n    f32.const nan\n    f32.const -nan\n    f32.gt\n    drop\n    ;; Non-canonical NaN encodings.\n    f32.const +nan:0x1\n    f32.const +nan:0xfffff\n    f32.le\n    drop\n    ;; TODO(dlehmann): Change to `0.1`, once `ImmediatesPrinter` is improved to\n    ;; print floats as shortest round-trippable decimal representation.\n    f32.const 0.100000001\n    f32.const 1234567.5\n    f32.ge\n    drop\n    ;; Arithmetic.\n    f32.const 0.0\n    f32.abs\n    f32.neg\n    f32.ceil\n    f32.floor\n    f32.trunc\n    f32.nearest\n    f32.sqrt\n    f32.const 0.0\n    f32.add\n    f32.const 0.0\n    f32.sub\n    f32.const 0.0\n    f32.mul\n    f32.const 0.0\n    f32.div\n    f32.const 0.0\n    f32.min\n    f32.const 0.0\n    f32.max\n    f32.const 0.0\n    f32.copysign\n    drop\n    ;; Conversions.\n    i32.const 0\n    f32.convert_i32_s\n    drop\n    i32.const 0\n    f32.convert_i32_u\n    drop\n    i64.const 0\n    f32.convert_i64_s\n    drop\n    i64.const 0\n    f32.convert_i64_u\n    drop\n    f64.const 0.0\n    f32.demote_f64\n    drop\n    i32.const 0\n    f32.reinterpret_i32\n  )\n  ;; f64 operations.\n  (func $func5 (result f64)\n    ;; Comparisons and constant literals.\n    f64.const 0.0\n    f64.const -0.0\n    f64.eq\n    drop\n    f64.const 1\n    f64.const -1\n    f64.ne\n    drop\n    f64.const inf\n    f64.const -inf\n    f64.lt\n    drop\n    f64.const nan\n    f64.const -nan\n    f64.gt\n    drop\n    ;; Non-canonical NaN encodings.\n    f64.const +nan:0x1\n    f64.const +nan:0xfffffffffffff\n    f64.le\n    drop\n    f64.const 0.1\n    f64.const 1234567.5\n    f64.ge\n    drop\n    ;; Arithmetic.\n    f64.const 0.0\n    f64.abs\n    f64.neg\n    f64.ceil\n    f64.floor\n    f64.trunc\n    f64.nearest\n    f64.sqrt\n    f64.const 0.0\n    f64.add\n    f64.const 0.0\n    f64.sub\n    f64.const 0.0\n    f64.mul\n    f64.const 0.0\n    f64.div\n    f64.const 0.0\n    f64.min\n    f64.const 0.0\n    f64.max\n    f64.const 0.0\n    f64.copysign\n    drop\n    ;; Conversions.\n    i32.const 0\n    f64.convert_i32_s\n    drop\n    i32.const 0\n    f64.convert_i32_u\n    drop\n    i64.const 0\n    f64.convert_i64_s\n    drop\n    i64.const 0\n    f64.convert_i64_u\n    drop\n    f32.const 0.0\n    f64.promote_f32\n    drop\n    i64.const 0\n    f64.reinterpret_i64\n  )\n  ;; Control-flow.\n  (func $func6\n    ;; Calls and return.\n    call $func7\n    i64.const 0\n    i32.const 0\n    call_indirect (param i64) (result f64)\n    return\n    ;; Blocks and loops, with and without block type.\n    block $label0\n      loop $label1\n        block (result i64)\n          loop $label2 (result i64)\n            ;; Branches\n            br $label0\n            i32.const 0\n            br_if $label1\n            i32.const 0\n            br_table $label0 $label1 $label1 $label2\n            i64.const 0\n          end $label2\n        end\n        drop\n      end $label1\n    end $label0\n    ;; Select and if.\n    i64.const 0\n    i64.const 1\n    i32.const 0\n    select\n    drop\n    i32.const 0\n    if (result i64)\n      i64.const 0\n    else\n      i64.const 1\n    end\n    drop\n  )\n  ;; Memory operations.\n  (func $func7\n    ;; Loads.\n    i32.const 0\n    i32.load\n    drop\n    i32.const 0\n    ;; Non-default memargs.\n    i64.load offset=3\n    drop\n    i32.const 0\n    f32.load align=2\n    drop\n    i32.const 0\n    f64.load offset=3 align=4\n    drop\n    i32.const 0\n    i32.load8_s\n    drop\n    i32.const 0\n    i32.load8_u\n    drop\n    i32.const 0\n    i32.load16_s\n    drop\n    i32.const 0\n    i32.load16_u\n    drop\n    i32.const 0\n    i64.load8_s\n    drop\n    i32.const 0\n    i64.load8_u\n    drop\n    i32.const 0\n    i64.load16_s\n    drop\n    i32.const 0\n    i64.load16_u\n    drop\n    i32.const 0\n    i64.load32_s\n    drop\n    i32.const 0\n    i64.load32_u\n    drop\n    ;; Stores.\n    i32.const 0\n    i32.const 0\n    i32.store\n    i32.const 0\n    i64.const 0\n    i64.store\n    i32.const 0\n    f32.const 0.0\n    f32.store\n    i32.const 0\n    f64.const 0.0\n    f64.store\n    i32.const 0\n    i32.const 0\n    i32.store8\n    i32.const 0\n    i32.const 0\n    i32.store16\n    i32.const 0\n    i64.const 0\n    i64.store8\n    i32.const 0\n    i64.const 0\n    i64.store16\n    i32.const 0\n    i64.const 0\n    i64.store32\n    ;; Other memory instructions.\n    memory.size\n    memory.grow\n    drop\n  )\n  ;; Other instructions. (Also an exported function.)\n  (func $exported_function (;8;) (export \"exported_function\")\n    nop\n    unreachable\n  )\n  ;; Data and element sections.\n  (data (global.get $env.imported_global) \"foo\\0a\\00\")\n)\n;;";