summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/wasmdump.c71
-rw-r--r--src/wasm-binary-reader-objdump.c195
-rw-r--r--src/wasm-binary-reader-objdump.h12
-rw-r--r--src/wasm-binary-reader.c6
-rw-r--r--src/wasm-binary-reader.h2
-rw-r--r--test/dump/basic.txt3
-rw-r--r--test/dump/basic_dump_only.txt3
-rw-r--r--test/dump/binary.txt3
-rw-r--r--test/dump/block-257-exprs-br.txt3
-rw-r--r--test/dump/block-257-exprs.txt3
-rw-r--r--test/dump/block.txt3
-rw-r--r--test/dump/br-block-named.txt3
-rw-r--r--test/dump/br-block.txt3
-rw-r--r--test/dump/br-loop-inner-expr.txt3
-rw-r--r--test/dump/br-loop-inner.txt3
-rw-r--r--test/dump/br-loop.txt3
-rw-r--r--test/dump/brif-loop.txt3
-rw-r--r--test/dump/brif.txt3
-rw-r--r--test/dump/brtable-empty.txt3
-rw-r--r--test/dump/brtable.txt3
-rw-r--r--test/dump/call.txt3
-rw-r--r--test/dump/callimport.txt3
-rw-r--r--test/dump/callindirect.txt3
-rw-r--r--test/dump/cast.txt3
-rw-r--r--test/dump/compare.txt3
-rw-r--r--test/dump/const.txt3
-rw-r--r--test/dump/convert.txt3
-rw-r--r--test/dump/current-memory.txt3
-rw-r--r--test/dump/debug-names.txt3
-rw-r--r--test/dump/dedupe-sig.txt3
-rw-r--r--test/dump/drop.txt3
-rw-r--r--test/dump/export-multi.txt3
-rw-r--r--test/dump/expr-br.txt3
-rw-r--r--test/dump/expr-brif.txt3
-rw-r--r--test/dump/func-exported.txt3
-rw-r--r--test/dump/func-multi.txt3
-rw-r--r--test/dump/func-named.txt3
-rw-r--r--test/dump/getglobal.txt3
-rw-r--r--test/dump/getlocal-param.txt3
-rw-r--r--test/dump/getlocal.txt3
-rw-r--r--test/dump/global.txt3
-rw-r--r--test/dump/grow-memory.txt3
-rw-r--r--test/dump/hexfloat_f32.txt3
-rw-r--r--test/dump/hexfloat_f64.txt3
-rw-r--r--test/dump/if-then-else-list.txt3
-rw-r--r--test/dump/if-then-list.txt3
-rw-r--r--test/dump/if.txt3
-rw-r--r--test/dump/import.txt3
-rw-r--r--test/dump/load-aligned.txt3
-rw-r--r--test/dump/load.txt3
-rw-r--r--test/dump/locals.txt3
-rw-r--r--test/dump/loop-257-exprs-br.txt3
-rw-r--r--test/dump/loop-257-exprs.txt3
-rw-r--r--test/dump/loop.txt3
-rw-r--r--test/dump/memory-1-byte.txt3
-rw-r--r--test/dump/memory-data-size.txt12
-rw-r--r--test/dump/memory-hex.txt3
-rw-r--r--test/dump/memory.txt3
-rw-r--r--test/dump/no-canonicalize.txt3
-rw-r--r--test/dump/nocheck.txt3
-rw-r--r--test/dump/nop.txt3
-rw-r--r--test/dump/param-multi.txt3
-rw-r--r--test/dump/result.txt3
-rw-r--r--test/dump/return.txt3
-rw-r--r--test/dump/select.txt3
-rw-r--r--test/dump/setglobal.txt3
-rw-r--r--test/dump/setlocal-param.txt3
-rw-r--r--test/dump/setlocal.txt3
-rw-r--r--test/dump/signatures.txt3
-rw-r--r--test/dump/store-aligned.txt3
-rw-r--r--test/dump/store.txt3
-rw-r--r--test/dump/string-escape.txt3
-rw-r--r--test/dump/string-hex.txt3
-rw-r--r--test/dump/table.txt3
-rw-r--r--test/dump/tee_local.txt3
-rw-r--r--test/dump/unary.txt3
-rw-r--r--test/dump/unreachable.txt3
77 files changed, 470 insertions, 41 deletions
diff --git a/src/tools/wasmdump.c b/src/tools/wasmdump.c
index 4a6fa0ca..5d7c46dc 100644
--- a/src/tools/wasmdump.c
+++ b/src/tools/wasmdump.c
@@ -28,9 +28,13 @@
#define PROGRAM_NAME "wasmdump"
+#define NOPE WASM_OPTION_NO_ARGUMENT
+#define YEP WASM_OPTION_HAS_ARGUMENT
+
enum {
FLAG_HEADERS,
FLAG_RAW,
+ FLAG_SECTION,
FLAG_DISASSEMBLE,
FLAG_VERBOSE,
FLAG_DEBUG,
@@ -45,26 +49,21 @@ static const char s_description[] =
" $ wasmdump test.wasm\n";
static WasmOption s_options[] = {
- {FLAG_HEADERS, 'h', "headers", NULL, WASM_OPTION_NO_ARGUMENT,
- "print headers"},
- {FLAG_RAW, 'r', "raw", NULL, WASM_OPTION_NO_ARGUMENT,
- "print raw section contents"},
- {FLAG_DISASSEMBLE, 'd', "disassemble", NULL, WASM_OPTION_NO_ARGUMENT,
- "disassemble function bodies"},
- {FLAG_DEBUG, '\0', "debug", NULL, WASM_OPTION_NO_ARGUMENT,
- "disassemble function bodies"},
- {FLAG_VERBOSE, 'v', "verbose", NULL, WASM_OPTION_NO_ARGUMENT,
- "Verbose output"},
- {FLAG_HELP, 'h', "help", NULL, WASM_OPTION_NO_ARGUMENT,
- "print this help message"},
+ {FLAG_HEADERS, 'h', "headers", NULL, NOPE, "print headers"},
+ {FLAG_SECTION, 'j', "section", NULL, YEP, "select just one section"},
+ {FLAG_RAW, 'r', "raw", NULL, NOPE, "print raw section contents"},
+ {FLAG_DISASSEMBLE, 'd', "disassemble", NULL, NOPE, "disassemble function bodies"},
+ {FLAG_DEBUG, '\0', "debug", NULL, NOPE, "disassemble function bodies"},
+ {FLAG_VERBOSE, 'v', "verbose", NULL, NOPE, "Verbose output"},
+ {FLAG_HELP, 'h', "help", NULL, NOPE, "print this help message"},
};
+
WASM_STATIC_ASSERT(NUM_FLAGS == WASM_ARRAY_SIZE(s_options));
-static const char* s_infile;
static WasmObjdumpOptions s_objdump_options;
static void on_argument(struct WasmOptionParser* parser, const char* argument) {
- s_infile = argument;
+ s_objdump_options.infile = argument;
}
static void on_option(struct WasmOptionParser* parser,
@@ -90,6 +89,10 @@ static void on_option(struct WasmOptionParser* parser,
s_objdump_options.verbose = WASM_TRUE;
break;
+ case FLAG_SECTION:
+ s_objdump_options.section_name = argument;
+ break;
+
case FLAG_HELP:
wasm_print_help(parser, PROGRAM_NAME);
exit(0);
@@ -113,7 +116,7 @@ static void parse_options(int argc, char** argv) {
parser.on_error = on_option_error;
wasm_parse_options(&parser, argc, argv);
- if (!s_infile) {
+ if (!s_objdump_options.infile) {
wasm_print_help(&parser, PROGRAM_NAME);
WASM_FATAL("No filename given.\n");
}
@@ -127,11 +130,45 @@ int main(int argc, char** argv) {
void* data;
size_t size;
- WasmResult result = wasm_read_file(allocator, s_infile, &data, &size);
+ WasmResult result = wasm_read_file(allocator, s_objdump_options.infile, &data, &size);
if (WASM_FAILED(result))
return result;
- result = wasm_read_binary_objdump(allocator, data, size, &s_objdump_options);
+ // Perform serveral passed over the binary in order to print out different
+ // types of information.
+
+ s_objdump_options.print_header = 1;
+
+ // Pass 1: Print the section headers
+ if (s_objdump_options.headers) {
+ s_objdump_options.mode = WASM_DUMP_HEADERS;
+ result = wasm_read_binary_objdump(allocator, data, size, &s_objdump_options);
+ if (WASM_FAILED(result))
+ goto done;
+ s_objdump_options.print_header = 0;
+ }
+ // Pass 2: Print extra information based on section type
+ if (s_objdump_options.verbose || s_objdump_options.section_name) {
+ s_objdump_options.mode = WASM_DUMP_DETAILS;
+ result = wasm_read_binary_objdump(allocator, data, size, &s_objdump_options);
+ if (WASM_FAILED(result))
+ goto done;
+ s_objdump_options.print_header = 0;
+ }
+ if (s_objdump_options.disassemble) {
+ s_objdump_options.mode = WASM_DUMP_DISASSEMBLE;
+ result = wasm_read_binary_objdump(allocator, data, size, &s_objdump_options);
+ if (WASM_FAILED(result))
+ goto done;
+ s_objdump_options.print_header = 0;
+ }
+ // Pass 3: Dump to raw contents of the sections
+ if (s_objdump_options.raw) {
+ s_objdump_options.mode = WASM_DUMP_RAW_DATA;
+ result = wasm_read_binary_objdump(allocator, data, size, &s_objdump_options);
+ }
+
+done:
wasm_free(allocator, data);
return result;
}
diff --git a/src/wasm-binary-reader-objdump.c b/src/wasm-binary-reader-objdump.c
index eb26106b..ad2f621a 100644
--- a/src/wasm-binary-reader-objdump.c
+++ b/src/wasm-binary-reader-objdump.c
@@ -17,6 +17,7 @@
#include "wasm-binary-reader-objdump.h"
#include <assert.h>
+#include <inttypes.h>
#include <string.h>
#include <stdio.h>
@@ -31,11 +32,21 @@ typedef struct Context {
size_t current_opcode_offset;
size_t last_opcode_end;
int indent_level;
+ WasmBool print_details;
+ WasmBool header_printed;
+ int section_found;
} Context;
+
+static WasmBool should_print_details(Context* ctx) {
+ if (ctx->options->mode != WASM_DUMP_DETAILS)
+ return WASM_FALSE;
+ return ctx->print_details;
+}
+
static void WASM_PRINTF_FORMAT(2, 3)
print_details(Context* ctx, const char* fmt, ...) {
- if (!ctx->options->verbose)
+ if (!should_print_details(ctx))
return;
va_list args;
va_start(args, fmt);
@@ -53,15 +64,28 @@ static WasmResult begin_section(Context* ctx,
const char* name,
size_t offset,
size_t size) {
- if (ctx->options->headers) {
- printf("%-12s start=%#010" PRIzx " end=%#010" PRIzx " (size=%#010" PRIzx
- ")\n",
- name, offset, offset + size, size);
- }
- if (ctx->options->raw) {
- printf("\n");
- wasm_write_memory_dump(ctx->out_stream, ctx->data + offset, size, offset,
- WASM_PRINT_CHARS, NULL);
+ switch (ctx->options->mode) {
+ case WASM_DUMP_HEADERS:
+ printf("%9s start=%#010" PRIzx " end=%#010" PRIzx " (size=%#010" PRIzx
+ ") ",
+ name, offset, offset + size, size);
+ break;
+ case WASM_DUMP_DETAILS:
+ if (!ctx->options->section_name || !strcasecmp(ctx->options->section_name, name)) {
+ printf("%s:\n", name);
+ ctx->print_details = WASM_TRUE;
+ ctx->section_found = WASM_TRUE;
+ } else {
+ ctx->print_details = WASM_FALSE;
+ }
+ break;
+ case WASM_DUMP_RAW_DATA:
+ printf("\nContents of section %s:\n", name);
+ wasm_write_memory_dump(ctx->out_stream, ctx->data + offset, size, offset,
+ WASM_PRINT_CHARS, NULL);
+ break;
+ case WASM_DUMP_DISASSEMBLE:
+ break;
}
return WASM_OK;
}
@@ -81,7 +105,53 @@ SEGSTART(names, "NAMES")
static WasmResult on_count(uint32_t count, void* user_data) {
Context* ctx = user_data;
- print_details(ctx, " - count: %d\n", count);
+ if (ctx->options->mode == WASM_DUMP_HEADERS) {
+ printf("count: %d\n", count);
+ }
+ return WASM_OK;
+}
+
+static WasmResult begin_module(uint32_t version, void* user_data) {
+ Context* ctx = user_data;
+ if (ctx->options->print_header) {
+ const char *basename = strrchr(ctx->options->infile, '/');
+ if (basename)
+ basename++;
+ else
+ basename = ctx->options->infile;
+ printf("%s:\tfile format wasm %#08x\n", basename, version);
+ ctx->header_printed = WASM_TRUE;
+ }
+
+ switch (ctx->options->mode) {
+ case WASM_DUMP_HEADERS:
+ printf("\n");
+ printf("Sections:\n");
+ break;
+ case WASM_DUMP_DETAILS:
+ printf("\n");
+ printf("Section Details:\n");
+ break;
+ case WASM_DUMP_DISASSEMBLE:
+ printf("\n");
+ printf("Code Disassembly:\n");
+ break;
+ case WASM_DUMP_RAW_DATA:
+ break;
+ }
+
+ return WASM_OK;
+}
+
+static WasmResult end_module(void *user_data) {
+ Context* ctx = user_data;
+ if (ctx->options->mode == WASM_DUMP_DETAILS && ctx->options->section_name) {
+ if (!ctx->section_found) {
+ printf("Section not found: %s\n", ctx->options->section_name);
+ return WASM_ERROR;
+ }
+ }
+
return WASM_OK;
}
@@ -244,7 +314,7 @@ static WasmResult on_signature(uint32_t index,
void* user_data) {
Context* ctx = user_data;
- if (!ctx->options->verbose)
+ if (!should_print_details(ctx))
return WASM_OK;
printf(" - [%d] (", index);
uint32_t i;
@@ -272,16 +342,30 @@ static WasmResult on_function_signature(uint32_t index,
static WasmResult begin_function_body(uint32_t index, void* user_data) {
Context* ctx = user_data;
- if (ctx->options->verbose || ctx->options->disassemble)
+
+ if (should_print_details(ctx))
+ printf(" - func %d\n", index);
+ if (ctx->options->mode == WASM_DUMP_DISASSEMBLE)
printf("func %d\n", index);
+
ctx->last_opcode_end = 0;
return WASM_OK;
}
+static WasmResult on_import(uint32_t index,
+ WasmStringSlice module_name,
+ WasmStringSlice field_name,
+ void* user_data) {
+ print_details(user_data, " - " PRIstringslice " " PRIstringslice "\n",
+ WASM_PRINTF_STRING_SLICE_ARG(module_name),
+ WASM_PRINTF_STRING_SLICE_ARG(field_name));
+ return WASM_OK;
+}
+
static WasmResult on_import_func(uint32_t index,
uint32_t sig_index,
void* user_data) {
- print_details(user_data, "- func sig=%d\n", sig_index);
+ print_details(user_data, " - func sig=%d\n", sig_index);
return WASM_OK;
}
@@ -289,16 +373,18 @@ static WasmResult on_import_table(uint32_t index,
WasmType elem_type,
const WasmLimits* elem_limits,
void* user_data) {
- /* TODO(sbc): print more useful information about the table here */
- print_details(user_data, "- table elem_type=%s\n",
- wasm_get_type_name(elem_type));
+ print_details(user_data,
+ " - table elem_type=%s init=%" PRId64 " max=%" PRId64 "\n",
+ wasm_get_type_name(elem_type),
+ elem_limits->initial,
+ elem_limits->max);
return WASM_OK;
}
static WasmResult on_import_memory(uint32_t index,
const WasmLimits* page_limits,
void* user_data) {
- print_details(user_data, "- memory\n");
+ print_details(user_data, " - memory\n");
return WASM_OK;
}
@@ -321,7 +407,12 @@ static WasmResult on_table(uint32_t index,
WasmType elem_type,
const WasmLimits* elem_limits,
void* user_data) {
- print_details(user_data, "- table %d\n", index);
+ print_details(user_data,
+ " - [%d] type=%#x init=%" PRId64 " max=%" PRId64 " \n",
+ index,
+ elem_type,
+ elem_limits->initial,
+ elem_limits->has_max ? elem_limits->max : 0);
return WASM_OK;
}
@@ -336,12 +427,64 @@ static WasmResult on_export(uint32_t index,
return WASM_OK;
}
+static WasmResult on_elem_segment_function_index(uint32_t index,
+ uint32_t func_index,
+ void* user_data) {
+ print_details(user_data, " - [%d] -> %d\n", index, func_index);
+ return WASM_OK;
+}
+
+static WasmResult begin_elem_segment(uint32_t index,
+ uint32_t table_index,
+ void* user_data) {
+ print_details(user_data, " - segment [%d] table=%d\n", index, table_index);
+ return WASM_OK;
+}
+
+static WasmResult on_init_expr_f32_const_expr(uint32_t index,
+ uint32_t value,
+ void* user_data) {
+ print_details(user_data, " - init f32=%d\n", value);
+ return WASM_OK;
+}
+
+static WasmResult on_init_expr_f64_const_expr(uint32_t index,
+ uint64_t value,
+ void* user_data) {
+ print_details(user_data, " - init f64=%" PRId64 "\n", value);
+ return WASM_OK;
+}
+
+static WasmResult on_init_expr_get_global_expr(uint32_t index,
+ uint32_t global_index,
+ void* user_data) {
+ print_details(user_data, " - init global=%d\n", global_index);
+ return WASM_OK;
+}
+
+static WasmResult on_init_expr_i32_const_expr(uint32_t index,
+ uint32_t value,
+ void* user_data) {
+ print_details(user_data, " - init i32=%d\n", value);
+ return WASM_OK;
+}
+
+static WasmResult on_init_expr_i64_const_expr(uint32_t index,
+ uint64_t value,
+ void* user_data) {
+ print_details(user_data, " - init i64=%" PRId64 "\n", value);
+ return WASM_OK;
+}
+
static void on_error(WasmBinaryReaderContext* ctx, const char* message) {
wasm_default_binary_error_callback(ctx->offset, message, ctx->user_data);
}
static WasmBinaryReader s_binary_reader = {
.user_data = NULL,
+
+ .begin_module = begin_module,
+ .end_module = end_module,
.on_error = on_error,
// Signature sections
@@ -352,6 +495,7 @@ static WasmBinaryReader s_binary_reader = {
// Import section
.begin_import_section = begin_import_section,
.on_import_count = on_count,
+ .on_import = on_import,
.on_import_func = on_import_func,
.on_import_table = on_import_table,
.on_import_memory = on_import_memory,
@@ -391,7 +535,9 @@ static WasmBinaryReader s_binary_reader = {
// Elems section
.begin_elem_section = begin_elem_section,
+ .begin_elem_segment = begin_elem_segment,
.on_elem_segment_count = on_count,
+ .on_elem_segment_function_index = on_elem_segment_function_index,
// Data section
.begin_data_section = begin_data_section,
@@ -400,6 +546,12 @@ static WasmBinaryReader s_binary_reader = {
// Names section
.begin_names_section = begin_names_section,
.on_function_names_count = on_count,
+
+ .on_init_expr_i32_const_expr = on_init_expr_i32_const_expr,
+ .on_init_expr_i64_const_expr = on_init_expr_i64_const_expr,
+ .on_init_expr_f32_const_expr = on_init_expr_f32_const_expr,
+ .on_init_expr_f64_const_expr = on_init_expr_f64_const_expr,
+ .on_init_expr_get_global_expr = on_init_expr_get_global_expr,
};
WasmResult wasm_read_binary_objdump(struct WasmAllocator* allocator,
@@ -411,12 +563,15 @@ WasmResult wasm_read_binary_objdump(struct WasmAllocator* allocator,
reader = s_binary_reader;
Context context;
WASM_ZERO_MEMORY(context);
+ context.header_printed = WASM_FALSE;
+ context.print_details = WASM_FALSE;
+ context.section_found = WASM_FALSE;
context.data = data;
context.size = size;
context.options = options;
context.out_stream = wasm_init_stdout_stream();
- if (options->disassemble) {
+ if (options->mode == WASM_DUMP_DISASSEMBLE) {
reader.on_opcode = on_opcode;
reader.on_opcode_bare = on_opcode_bare;
reader.on_opcode_uint32 = on_opcode_uint32;
diff --git a/src/wasm-binary-reader-objdump.h b/src/wasm-binary-reader-objdump.h
index c0318f14..06a19118 100644
--- a/src/wasm-binary-reader-objdump.h
+++ b/src/wasm-binary-reader-objdump.h
@@ -24,15 +24,27 @@ struct WasmAllocator;
struct WasmModule;
struct WasmReadBinaryOptions;
+typedef enum WasmObjdumpMode {
+ WASM_DUMP_HEADERS,
+ WASM_DUMP_DETAILS,
+ WASM_DUMP_DISASSEMBLE,
+ WASM_DUMP_RAW_DATA,
+} WasmObjdumpMode;
+
typedef struct WasmObjdumpOptions {
WasmBool headers;
WasmBool verbose;
WasmBool raw;
WasmBool disassemble;
WasmBool debug;
+ WasmObjdumpMode mode;
+ const char* infile;
+ const char* section_name;
+ WasmBool print_header;
} WasmObjdumpOptions;
WASM_EXTERN_C_BEGIN
+
WasmResult wasm_read_binary_objdump(struct WasmAllocator* allocator,
const uint8_t* data,
size_t size,
diff --git a/src/wasm-binary-reader.c b/src/wasm-binary-reader.c
index 21b2169d..950b6752 100644
--- a/src/wasm-binary-reader.c
+++ b/src/wasm-binary-reader.c
@@ -589,7 +589,7 @@ static void logging_on_error(WasmBinaryReaderContext* ctx,
FORWARD0(name); \
}
-LOGGING0(begin_module)
+LOGGING_UINT32(begin_module)
LOGGING0(end_module)
LOGGING_BEGIN(signature_section)
LOGGING_UINT32(on_signature_count)
@@ -1706,8 +1706,6 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
wasm_reserve_uint32s(allocator, &ctx->target_depths,
INITIAL_BR_TABLE_TARGET_CAPACITY);
- CALLBACK0(begin_module);
-
uint32_t magic;
in_u32(ctx, &magic, "magic");
RAISE_ERROR_UNLESS(magic == WASM_BINARY_MAGIC, "bad magic value");
@@ -1717,6 +1715,8 @@ WasmResult wasm_read_binary(WasmAllocator* allocator,
"bad wasm file version: %#x (expected %#x)", version,
WASM_BINARY_VERSION);
+ CALLBACK(begin_module, version);
+
/* type */
uint32_t section_size;
if (skip_until_section(ctx, WASM_BINARY_SECTION_TYPE, &section_size)) {
diff --git a/src/wasm-binary-reader.h b/src/wasm-binary-reader.h
index 59bfffcf..424203e9 100644
--- a/src/wasm-binary-reader.h
+++ b/src/wasm-binary-reader.h
@@ -46,7 +46,7 @@ typedef struct WasmBinaryReader {
void (*on_error)(WasmBinaryReaderContext* ctx, const char* message);
/* module */
- WasmResult (*begin_module)(void* user_data);
+ WasmResult (*begin_module)(uint32_t version, void* user_data);
WasmResult (*end_module)(void* user_data);
/* signatures section */
diff --git a/test/dump/basic.txt b/test/dump/basic.txt
index ac1e83c1..24617d7a 100644
--- a/test/dump/basic.txt
+++ b/test/dump/basic.txt
@@ -79,6 +79,9 @@
0000038: 0b ; end
0000024: 14 ; FIXUP func body size
0000022: 16 ; FIXUP section size
+basic.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000026: 41 00 | i32.const 0
000028: 41 00 | i32.const 0
diff --git a/test/dump/basic_dump_only.txt b/test/dump/basic_dump_only.txt
index 17dda7f4..e773767c 100644
--- a/test/dump/basic_dump_only.txt
+++ b/test/dump/basic_dump_only.txt
@@ -13,6 +13,9 @@
i32.add)
(export "f" (func $f)))
(;; STDOUT ;;;
+basic_dump_only.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000026: 41 00 | i32.const 0
000028: 41 00 | i32.const 0
diff --git a/test/dump/binary.txt b/test/dump/binary.txt
index 154268cd..e043a17f 100644
--- a/test/dump/binary.txt
+++ b/test/dump/binary.txt
@@ -275,6 +275,9 @@
0000015: e201 ; FIXUP func body size
; move data: [14, f9) -> [15, fa)
0000013: e501 ; FIXUP section size
+binary.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 41 00 | i32.const 0
00001b: 41 00 | i32.const 0
diff --git a/test/dump/block-257-exprs-br.txt b/test/dump/block-257-exprs-br.txt
index f60b5ad3..b8d89ba8 100644
--- a/test/dump/block-257-exprs-br.txt
+++ b/test/dump/block-257-exprs-br.txt
@@ -340,6 +340,9 @@
0000015: 8902 ; FIXUP func body size
; move data: [14, 120) -> [15, 121)
0000013: 8c02 ; FIXUP section size
+block-257-exprs-br.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 02 40 | block
00001b: 01 | nop
diff --git a/test/dump/block-257-exprs.txt b/test/dump/block-257-exprs.txt
index a863b34e..9613c4f7 100644
--- a/test/dump/block-257-exprs.txt
+++ b/test/dump/block-257-exprs.txt
@@ -336,6 +336,9 @@
0000015: 8602 ; FIXUP func body size
; move data: [14, 11d) -> [15, 11e)
0000013: 8902 ; FIXUP section size
+block-257-exprs.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 02 40 | block
00001b: 01 | nop
diff --git a/test/dump/block.txt b/test/dump/block.txt
index 7466e312..0ec1e922 100644
--- a/test/dump/block.txt
+++ b/test/dump/block.txt
@@ -62,6 +62,9 @@
000002a: 0b ; end
0000023: 07 ; FIXUP func body size
0000018: 12 ; FIXUP section size
+block.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
00001c: 02 40 | block
00001e: 01 | nop
diff --git a/test/dump/br-block-named.txt b/test/dump/br-block-named.txt
index aa025d5c..1a887713 100644
--- a/test/dump/br-block-named.txt
+++ b/test/dump/br-block-named.txt
@@ -61,6 +61,9 @@
000002a: 0b ; end
0000015: 15 ; FIXUP func body size
0000013: 17 ; FIXUP section size
+br-block-named.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 03 40 | loop
diff --git a/test/dump/br-block.txt b/test/dump/br-block.txt
index a0152744..df876997 100644
--- a/test/dump/br-block.txt
+++ b/test/dump/br-block.txt
@@ -67,6 +67,9 @@
000002e: 0b ; end
0000015: 19 ; FIXUP func body size
0000013: 1b ; FIXUP section size
+br-block.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 03 40 | loop
diff --git a/test/dump/br-loop-inner-expr.txt b/test/dump/br-loop-inner-expr.txt
index af38ea78..d093a678 100644
--- a/test/dump/br-loop-inner-expr.txt
+++ b/test/dump/br-loop-inner-expr.txt
@@ -69,6 +69,9 @@
0000030: 0b ; end
0000016: 1a ; FIXUP func body size
0000014: 1c ; FIXUP section size
+br-loop-inner-expr.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000018: 02 7f | block i32
00001a: 03 7f | loop i32
diff --git a/test/dump/br-loop-inner.txt b/test/dump/br-loop-inner.txt
index fe255a5c..35934596 100644
--- a/test/dump/br-loop-inner.txt
+++ b/test/dump/br-loop-inner.txt
@@ -55,6 +55,9 @@
000002b: 0b ; end
0000015: 16 ; FIXUP func body size
0000013: 18 ; FIXUP section size
+br-loop-inner.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 03 40 | loop
diff --git a/test/dump/br-loop.txt b/test/dump/br-loop.txt
index 358f8fd3..0e289f9a 100644
--- a/test/dump/br-loop.txt
+++ b/test/dump/br-loop.txt
@@ -46,6 +46,9 @@
0000021: 0b ; end
0000015: 0c ; FIXUP func body size
0000013: 0e ; FIXUP section size
+br-loop.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 03 40 | loop
000019: 41 01 | i32.const 0x1
diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt
index 062c198c..a68308c9 100644
--- a/test/dump/brif-loop.txt
+++ b/test/dump/brif-loop.txt
@@ -41,6 +41,9 @@
000001e: 0b ; end
0000015: 09 ; FIXUP func body size
0000013: 0b ; FIXUP section size
+brif-loop.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 03 40 | loop
000019: 41 00 | i32.const 0
diff --git a/test/dump/brif.txt b/test/dump/brif.txt
index 439ce113..35321ac4 100644
--- a/test/dump/brif.txt
+++ b/test/dump/brif.txt
@@ -41,6 +41,9 @@
000001e: 0b ; end
0000015: 09 ; FIXUP func body size
0000013: 0b ; FIXUP section size
+brif.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 41 01 | i32.const 0x1
diff --git a/test/dump/brtable-empty.txt b/test/dump/brtable-empty.txt
index 034387d9..3aced89e 100644
--- a/test/dump/brtable-empty.txt
+++ b/test/dump/brtable-empty.txt
@@ -42,6 +42,9 @@
000001f: 0b ; end
0000015: 0a ; FIXUP func body size
0000013: 0c ; FIXUP section size
+brtable-empty.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 41 00 | i32.const 0
diff --git a/test/dump/brtable.txt b/test/dump/brtable.txt
index d5fbc75a..4b6711c5 100644
--- a/test/dump/brtable.txt
+++ b/test/dump/brtable.txt
@@ -75,6 +75,9 @@
0000032: 0b ; end
0000015: 1d ; FIXUP func body size
0000013: 1f ; FIXUP section size
+brtable.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 02 40 | block
000019: 02 40 | block
diff --git a/test/dump/call.txt b/test/dump/call.txt
index b9a7d0d2..39c038e6 100644
--- a/test/dump/call.txt
+++ b/test/dump/call.txt
@@ -37,6 +37,9 @@
000001c: 0b ; end
0000016: 06 ; FIXUP func body size
0000014: 08 ; FIXUP section size
+call.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000018: 41 01 | i32.const 0x1
00001a: 10 00 | call 0
diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt
index 0addac4f..de8b7290 100644
--- a/test/dump/callimport.txt
+++ b/test/dump/callimport.txt
@@ -67,6 +67,9 @@
0000037: 0b ; end
0000029: 0e ; FIXUP func body size
0000027: 10 ; FIXUP section size
+callimport.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
00002b: 41 01 | i32.const 0x1
00002d: 43 00 00 00 40 | f32.const 0x40000000
diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt
index 94de4d9c..2e577dfd 100644
--- a/test/dump/callindirect.txt
+++ b/test/dump/callindirect.txt
@@ -65,6 +65,9 @@
000002f: 0b ; end
0000026: 09 ; FIXUP func body size
0000024: 0b ; FIXUP section size
+callindirect.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000028: 41 00 | i32.const 0
00002a: 41 00 | i32.const 0
diff --git a/test/dump/cast.txt b/test/dump/cast.txt
index c4927848..32af2226 100644
--- a/test/dump/cast.txt
+++ b/test/dump/cast.txt
@@ -58,6 +58,9 @@
0000031: 0b ; end
0000015: 1c ; FIXUP func body size
0000013: 1e ; FIXUP section size
+cast.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: be | f32.reinterpret/i32
diff --git a/test/dump/compare.txt b/test/dump/compare.txt
index 0ee2b66c..42f7d617 100644
--- a/test/dump/compare.txt
+++ b/test/dump/compare.txt
@@ -310,6 +310,9 @@
0000015: 9f02 ; FIXUP func body size
; move data: [14, 136) -> [15, 137)
0000013: a202 ; FIXUP section size
+compare.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 41 00 | i32.const 0
00001b: 41 00 | i32.const 0
diff --git a/test/dump/const.txt b/test/dump/const.txt
index 2bf14541..f226f7e7 100644
--- a/test/dump/const.txt
+++ b/test/dump/const.txt
@@ -222,6 +222,9 @@
0000015: 9a02 ; FIXUP func body size
; move data: [14, 131) -> [15, 132)
0000013: 9d02 ; FIXUP section size
+const.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 41 00 | i32.const 0
00001b: 1a | drop
diff --git a/test/dump/convert.txt b/test/dump/convert.txt
index 1470b2a6..6e0a0971 100644
--- a/test/dump/convert.txt
+++ b/test/dump/convert.txt
@@ -89,6 +89,9 @@
0000038: 0b ; end
0000015: 23 ; FIXUP func body size
0000013: 25 ; FIXUP section size
+convert.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: b8 | f64.convert_u/i32
diff --git a/test/dump/current-memory.txt b/test/dump/current-memory.txt
index 88e640ce..8c3a47a5 100644
--- a/test/dump/current-memory.txt
+++ b/test/dump/current-memory.txt
@@ -43,6 +43,9 @@
000001f: 0b ; end
000001b: 04 ; FIXUP func body size
0000019: 06 ; FIXUP section size
+current-memory.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
00001d: 3f 00 | current_memory 0
;;; STDOUT ;;)
diff --git a/test/dump/debug-names.txt b/test/dump/debug-names.txt
index 47849bb0..749c0766 100644
--- a/test/dump/debug-names.txt
+++ b/test/dump/debug-names.txt
@@ -85,6 +85,9 @@
000005b: 05 ; string length
000005c: 2446 324c 33 $F2L3 ; local name 3
000002a: 36 ; FIXUP section size
+debug-names.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
func 1
;;; STDOUT ;;)
diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt
index 26d5f16d..344616fb 100644
--- a/test/dump/dedupe-sig.txt
+++ b/test/dump/dedupe-sig.txt
@@ -49,6 +49,9 @@
0000028: 0b ; end
0000024: 04 ; FIXUP func body size
0000022: 06 ; FIXUP section size
+dedupe-sig.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000026: 42 00 | i64.const 0
;;; STDOUT ;;)
diff --git a/test/dump/drop.txt b/test/dump/drop.txt
index 8d2cf8b5..20614380 100644
--- a/test/dump/drop.txt
+++ b/test/dump/drop.txt
@@ -35,6 +35,9 @@
000001a: 0b ; end
0000015: 05 ; FIXUP func body size
0000013: 07 ; FIXUP section size
+drop.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 1a | drop
diff --git a/test/dump/export-multi.txt b/test/dump/export-multi.txt
index f2601abc..6edc0011 100644
--- a/test/dump/export-multi.txt
+++ b/test/dump/export-multi.txt
@@ -46,6 +46,9 @@
0000023: 0b ; end
0000020: 03 ; FIXUP func body size
000001e: 05 ; FIXUP section size
+export-multi.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000022: 01 | nop
;;; STDOUT ;;)
diff --git a/test/dump/expr-br.txt b/test/dump/expr-br.txt
index b5b6a2cd..76870b40 100644
--- a/test/dump/expr-br.txt
+++ b/test/dump/expr-br.txt
@@ -43,6 +43,9 @@
000001f: 0b ; end
0000016: 09 ; FIXUP func body size
0000014: 0b ; FIXUP section size
+expr-br.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000018: 02 7f | block i32
00001a: 41 01 | i32.const 0x1
diff --git a/test/dump/expr-brif.txt b/test/dump/expr-brif.txt
index 8e36e6e1..80124417 100644
--- a/test/dump/expr-brif.txt
+++ b/test/dump/expr-brif.txt
@@ -50,6 +50,9 @@
0000024: 0b ; end
0000016: 0e ; FIXUP func body size
0000014: 10 ; FIXUP section size
+expr-brif.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000018: 02 7f | block i32
00001a: 41 2a | i32.const 0x2a
diff --git a/test/dump/func-exported.txt b/test/dump/func-exported.txt
index 99852bae..c72ee172 100644
--- a/test/dump/func-exported.txt
+++ b/test/dump/func-exported.txt
@@ -40,5 +40,8 @@
0000020: 0b ; end
000001e: 02 ; FIXUP func body size
000001c: 04 ; FIXUP section size
+func-exported.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt
index e2975ab7..5282ba2f 100644
--- a/test/dump/func-multi.txt
+++ b/test/dump/func-multi.txt
@@ -44,6 +44,9 @@
000001f: 0b ; end
000001d: 02 ; FIXUP func body size
0000015: 0a ; FIXUP section size
+func-multi.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
func 1
func 2
diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt
index faff708c..4cd81015 100644
--- a/test/dump/func-named.txt
+++ b/test/dump/func-named.txt
@@ -30,5 +30,8 @@
0000017: 0b ; end
0000015: 02 ; FIXUP func body size
0000013: 04 ; FIXUP section size
+func-named.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/getglobal.txt b/test/dump/getglobal.txt
index c949841f..af0783fc 100644
--- a/test/dump/getglobal.txt
+++ b/test/dump/getglobal.txt
@@ -45,6 +45,9 @@
0000022: 0b ; end
000001e: 04 ; FIXUP func body size
000001c: 06 ; FIXUP section size
+getglobal.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000020: 23 00 | get_global 0
;;; STDOUT ;;)
diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt
index 6b740302..9a5c0313 100644
--- a/test/dump/getlocal-param.txt
+++ b/test/dump/getlocal-param.txt
@@ -78,6 +78,9 @@
0000033: 0b ; end
0000017: 1c ; FIXUP func body size
0000015: 1e ; FIXUP section size
+getlocal-param.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000021: 20 00 | get_local 0
000023: 1a | drop
diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt
index 8f91d54b..e6def2d7 100644
--- a/test/dump/getlocal.txt
+++ b/test/dump/getlocal.txt
@@ -91,6 +91,9 @@
000003d: 0b ; end
0000015: 28 ; FIXUP func body size
0000013: 2a ; FIXUP section size
+getlocal.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000025: 20 00 | get_local 0
000027: 1a | drop
diff --git a/test/dump/global.txt b/test/dump/global.txt
index 7f69dd23..18e22e6f 100644
--- a/test/dump/global.txt
+++ b/test/dump/global.txt
@@ -58,4 +58,7 @@
000003b: 03 ; global index
000003c: 0b ; end
0000009: 33 ; FIXUP section size
+global.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/grow-memory.txt b/test/dump/grow-memory.txt
index ee0dc06d..aec9ec52 100644
--- a/test/dump/grow-memory.txt
+++ b/test/dump/grow-memory.txt
@@ -49,6 +49,9 @@
0000023: 0b ; end
000001c: 07 ; FIXUP func body size
000001a: 09 ; FIXUP section size
+grow-memory.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
00001e: 20 00 | get_local 0
000020: 40 00 | grow_memory 0
diff --git a/test/dump/hexfloat_f32.txt b/test/dump/hexfloat_f32.txt
index 4029bfc1..3fb5f79b 100644
--- a/test/dump/hexfloat_f32.txt
+++ b/test/dump/hexfloat_f32.txt
@@ -117,6 +117,9 @@
000007d: 0b ; end
0000015: 68 ; FIXUP func body size
0000013: 6a ; FIXUP section size
+hexfloat_f32.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 43 00 00 00 00 | f32.const 0
00001c: 1a | drop
diff --git a/test/dump/hexfloat_f64.txt b/test/dump/hexfloat_f64.txt
index 58b8de9c..c94f7ca5 100644
--- a/test/dump/hexfloat_f64.txt
+++ b/test/dump/hexfloat_f64.txt
@@ -119,6 +119,9 @@
0000015: ac01 ; FIXUP func body size
; move data: [14, c3) -> [15, c4)
0000013: af01 ; FIXUP section size
+hexfloat_f64.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 44 00 00 00 00 00 00 00 00 | f64.const 0
000022: 1a | drop
diff --git a/test/dump/if-then-else-list.txt b/test/dump/if-then-else-list.txt
index 3c6e2c4b..0c4d6939 100644
--- a/test/dump/if-then-else-list.txt
+++ b/test/dump/if-then-else-list.txt
@@ -60,6 +60,9 @@
0000029: 0b ; end
0000015: 14 ; FIXUP func body size
0000013: 16 ; FIXUP section size
+if-then-else-list.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 01 | i32.const 0x1
000019: 04 40 | if
diff --git a/test/dump/if-then-list.txt b/test/dump/if-then-list.txt
index d92074d7..e30cfb70 100644
--- a/test/dump/if-then-list.txt
+++ b/test/dump/if-then-list.txt
@@ -42,6 +42,9 @@
000001e: 0b ; end
0000015: 09 ; FIXUP func body size
0000013: 0b ; FIXUP section size
+if-then-list.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 01 | i32.const 0x1
000019: 04 40 | if
diff --git a/test/dump/if.txt b/test/dump/if.txt
index 9b3ffba0..6a5ebbaf 100644
--- a/test/dump/if.txt
+++ b/test/dump/if.txt
@@ -79,6 +79,9 @@
000003a: 0b ; end
0000030: 0a ; FIXUP func body size
0000014: 26 ; FIXUP section size
+if.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000018: 41 01 | i32.const 0x1
00001a: 04 40 | if
diff --git a/test/dump/import.txt b/test/dump/import.txt
index 4db9763e..30d022c4 100644
--- a/test/dump/import.txt
+++ b/test/dump/import.txt
@@ -44,4 +44,7 @@
0000037: 00 ; import kind
0000038: 01 ; import signature index
0000018: 20 ; FIXUP section size
+import.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt
index 3d3e9d5d..034ead3e 100644
--- a/test/dump/load-aligned.txt
+++ b/test/dump/load-aligned.txt
@@ -174,6 +174,9 @@
0000077: 0b ; end
0000015: 62 ; FIXUP func body size
0000013: 64 ; FIXUP section size
+load-aligned.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 2c 00 00 | i32.load8_s 0 0
diff --git a/test/dump/load.txt b/test/dump/load.txt
index 3ec05c5f..23f85900 100644
--- a/test/dump/load.txt
+++ b/test/dump/load.txt
@@ -156,6 +156,9 @@
000006b: 0b ; end
0000015: 56 ; FIXUP func body size
0000013: 58 ; FIXUP section size
+load.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 28 02 00 | i32.load 2 0
diff --git a/test/dump/locals.txt b/test/dump/locals.txt
index ad14e3a2..faf4ff44 100644
--- a/test/dump/locals.txt
+++ b/test/dump/locals.txt
@@ -38,5 +38,8 @@
000001f: 0b ; end
0000015: 0a ; FIXUP func body size
0000013: 0c ; FIXUP section size
+locals.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/loop-257-exprs-br.txt b/test/dump/loop-257-exprs-br.txt
index 92363c3e..2f11bd83 100644
--- a/test/dump/loop-257-exprs-br.txt
+++ b/test/dump/loop-257-exprs-br.txt
@@ -353,6 +353,9 @@
0000015: 9002 ; FIXUP func body size
; move data: [14, 127) -> [15, 128)
0000013: 9302 ; FIXUP section size
+loop-257-exprs-br.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 02 40 | block
00001b: 03 40 | loop
diff --git a/test/dump/loop-257-exprs.txt b/test/dump/loop-257-exprs.txt
index 68f82f1a..bce5a238 100644
--- a/test/dump/loop-257-exprs.txt
+++ b/test/dump/loop-257-exprs.txt
@@ -336,6 +336,9 @@
0000015: 8602 ; FIXUP func body size
; move data: [14, 11d) -> [15, 11e)
0000013: 8902 ; FIXUP section size
+loop-257-exprs.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 03 40 | loop
00001b: 01 | nop
diff --git a/test/dump/loop.txt b/test/dump/loop.txt
index 1b1a2a0c..d5d5e4f4 100644
--- a/test/dump/loop.txt
+++ b/test/dump/loop.txt
@@ -39,6 +39,9 @@
000001c: 0b ; end
0000015: 07 ; FIXUP func body size
0000013: 09 ; FIXUP section size
+loop.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 03 40 | loop
000019: 01 | nop
diff --git a/test/dump/memory-1-byte.txt b/test/dump/memory-1-byte.txt
index 70891a05..a97a9d6b 100644
--- a/test/dump/memory-1-byte.txt
+++ b/test/dump/memory-1-byte.txt
@@ -12,4 +12,7 @@
000000b: 00 ; memory flags
000000c: 01 ; memory initial pages
0000009: 03 ; FIXUP section size
+memory-1-byte.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/memory-data-size.txt b/test/dump/memory-data-size.txt
index 0db8a0dc..209de395 100644
--- a/test/dump/memory-data-size.txt
+++ b/test/dump/memory-data-size.txt
@@ -45,4 +45,16 @@
000000b: 00 ; memory flags
000000c: 05 ; memory initial pages
0000009: 03 ; FIXUP section size
+memory-data-size.0.wasm: file format wasm 0x00000d
+
+Code Disassembly:
+memory-data-size.1.wasm: file format wasm 0x00000d
+
+Code Disassembly:
+memory-data-size.2.wasm: file format wasm 0x00000d
+
+Code Disassembly:
+memory-data-size.3.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/memory-hex.txt b/test/dump/memory-hex.txt
index c9922207..8ab1024d 100644
--- a/test/dump/memory-hex.txt
+++ b/test/dump/memory-hex.txt
@@ -28,4 +28,7 @@
; data segment data 0
0000016: 0001 0203 0405 0607 0809 0a ; data segment data
000000f: 11 ; FIXUP section size
+memory-hex.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/memory.txt b/test/dump/memory.txt
index 5b7a32bf..43c472e1 100644
--- a/test/dump/memory.txt
+++ b/test/dump/memory.txt
@@ -36,4 +36,7 @@
; data segment data 1
000001f: 676f 6f64 6279 65 ; data segment data
000000e: 17 ; FIXUP section size
+memory.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/no-canonicalize.txt b/test/dump/no-canonicalize.txt
index dfb21f82..40755522 100644
--- a/test/dump/no-canonicalize.txt
+++ b/test/dump/no-canonicalize.txt
@@ -146,6 +146,9 @@
0000099: 0b ; end
000008d: 8880 8080 00 ; FIXUP func body size
000006b: aa80 8080 00 ; FIXUP section size
+no-canonicalize.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000077: 20 00 | get_local 0
000079: 20 01 | get_local 0x1
diff --git a/test/dump/nocheck.txt b/test/dump/nocheck.txt
index 85b36001..f9f4442d 100644
--- a/test/dump/nocheck.txt
+++ b/test/dump/nocheck.txt
@@ -49,6 +49,9 @@
0000030: 0b ; end
000001f: 11 ; FIXUP func body size
000001d: 13 ; FIXUP section size
+nocheck.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000021: 43 00 00 80 3f | f32.const 0x3f800000
000026: 44 00 00 00 00 00 00 00 40 | f64.const 0
diff --git a/test/dump/nop.txt b/test/dump/nop.txt
index 7caa38c7..d10e8a52 100644
--- a/test/dump/nop.txt
+++ b/test/dump/nop.txt
@@ -32,6 +32,9 @@
0000018: 0b ; end
0000015: 03 ; FIXUP func body size
0000013: 05 ; FIXUP section size
+nop.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 01 | nop
;;; STDOUT ;;)
diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt
index c0d96c9f..0a3cdda1 100644
--- a/test/dump/param-multi.txt
+++ b/test/dump/param-multi.txt
@@ -34,5 +34,8 @@
000001b: 0b ; end
0000019: 02 ; FIXUP func body size
0000017: 04 ; FIXUP section size
+param-multi.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/result.txt b/test/dump/result.txt
index e555916a..8cba3d98 100644
--- a/test/dump/result.txt
+++ b/test/dump/result.txt
@@ -79,6 +79,9 @@
0000042: 0b ; end
0000037: 0b ; FIXUP func body size
0000023: 1f ; FIXUP section size
+result.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000027: 41 00 | i32.const 0
func 1
diff --git a/test/dump/return.txt b/test/dump/return.txt
index 342dafef..b0f7d6d3 100644
--- a/test/dump/return.txt
+++ b/test/dump/return.txt
@@ -49,6 +49,9 @@
0000023: 0b ; end
0000020: 03 ; FIXUP func body size
0000018: 0b ; FIXUP section size
+return.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
00001c: 41 2a | i32.const 0x2a
00001e: 0f | return
diff --git a/test/dump/select.txt b/test/dump/select.txt
index 5eabcb78..87deda5f 100644
--- a/test/dump/select.txt
+++ b/test/dump/select.txt
@@ -82,6 +82,9 @@
000004b: 0b ; end
0000015: 36 ; FIXUP func body size
0000013: 38 ; FIXUP section size
+select.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 02 | i32.const 0x2
000019: 41 03 | i32.const 0x3
diff --git a/test/dump/setglobal.txt b/test/dump/setglobal.txt
index 2cb586f0..f5c974aa 100644
--- a/test/dump/setglobal.txt
+++ b/test/dump/setglobal.txt
@@ -47,6 +47,9 @@
0000029: 0b ; end
0000020: 09 ; FIXUP func body size
000001e: 0b ; FIXUP section size
+setglobal.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000022: 43 00 00 00 40 | f32.const 0x40000000
000027: 24 00 | set_global 0
diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt
index dd057c5c..b942dc45 100644
--- a/test/dump/setlocal-param.txt
+++ b/test/dump/setlocal-param.txt
@@ -81,6 +81,9 @@
0000042: 0b ; end
0000017: 2b ; FIXUP func body size
0000015: 2d ; FIXUP section size
+setlocal-param.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000021: 41 00 | i32.const 0
000023: 21 00 | set_local 0
diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt
index 4dd01f4a..8988f2b4 100644
--- a/test/dump/setlocal.txt
+++ b/test/dump/setlocal.txt
@@ -97,6 +97,9 @@
0000059: 0b ; end
0000015: 44 ; FIXUP func body size
0000013: 46 ; FIXUP section size
+setlocal.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000025: 44 00 00 00 00 00 00 00 00 | f64.const 0
00002e: 21 00 | set_local 0
diff --git a/test/dump/signatures.txt b/test/dump/signatures.txt
index 1dcafbcd..61f4a392 100644
--- a/test/dump/signatures.txt
+++ b/test/dump/signatures.txt
@@ -66,4 +66,7 @@
000002e: 01 ; num results
000002f: 7c ; f64
0000009: 26 ; FIXUP section size
+signatures.wasm: file format wasm 0x00000d
+
+Code Disassembly:
;;; STDOUT ;;)
diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt
index ac33891b..6fb2ed15 100644
--- a/test/dump/store-aligned.txt
+++ b/test/dump/store-aligned.txt
@@ -190,6 +190,9 @@
0000087: 0b ; end
0000015: 72 ; FIXUP func body size
0000013: 74 ; FIXUP section size
+store-aligned.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 41 00 | i32.const 0
diff --git a/test/dump/store.txt b/test/dump/store.txt
index 4c8df946..db3927f6 100644
--- a/test/dump/store.txt
+++ b/test/dump/store.txt
@@ -120,6 +120,9 @@
0000060: 0b ; end
0000015: 4b ; FIXUP func body size
0000013: 4d ; FIXUP section size
+store.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 41 00 | i32.const 0
diff --git a/test/dump/string-escape.txt b/test/dump/string-escape.txt
index cdde1468..f62526e0 100644
--- a/test/dump/string-escape.txt
+++ b/test/dump/string-escape.txt
@@ -40,5 +40,8 @@
0000045: 0b ; end
0000043: 02 ; FIXUP func body size
0000041: 04 ; FIXUP section size
+string-escape.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/string-hex.txt b/test/dump/string-hex.txt
index 516a7019..01a9704e 100644
--- a/test/dump/string-hex.txt
+++ b/test/dump/string-hex.txt
@@ -38,5 +38,8 @@
0000024: 0b ; end
0000022: 02 ; FIXUP func body size
0000020: 04 ; FIXUP section size
+string-hex.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
;;; STDOUT ;;)
diff --git a/test/dump/table.txt b/test/dump/table.txt
index 27c933b3..0f2fdb89 100644
--- a/test/dump/table.txt
+++ b/test/dump/table.txt
@@ -86,6 +86,9 @@
0000045: 0b ; end
000003a: 0b ; FIXUP func body size
0000032: 13 ; FIXUP section size
+table.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
func 1
func 2
diff --git a/test/dump/tee_local.txt b/test/dump/tee_local.txt
index 86989a2b..78f4433c 100644
--- a/test/dump/tee_local.txt
+++ b/test/dump/tee_local.txt
@@ -41,6 +41,9 @@
000001e: 0b ; end
0000015: 09 ; FIXUP func body size
0000013: 0b ; FIXUP section size
+tee_local.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000019: 41 00 | i32.const 0
00001b: 22 00 | tee_local 0
diff --git a/test/dump/unary.txt b/test/dump/unary.txt
index ade4b38e..6b19aa55 100644
--- a/test/dump/unary.txt
+++ b/test/dump/unary.txt
@@ -95,6 +95,9 @@
0000042: 0b ; end
0000015: 2d ; FIXUP func body size
0000013: 2f ; FIXUP section size
+unary.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 41 00 | i32.const 0
000019: 69 | i32.popcnt
diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt
index 7e8d68b2..f507ba25 100644
--- a/test/dump/unreachable.txt
+++ b/test/dump/unreachable.txt
@@ -32,6 +32,9 @@
0000018: 0b ; end
0000015: 03 ; FIXUP func body size
0000013: 05 ; FIXUP section size
+unreachable.wasm: file format wasm 0x00000d
+
+Code Disassembly:
func 0
000017: 00 | unreachable
;;; STDOUT ;;)