Compare commits

..

No commits in common. "867dbd8912f8fd489ea9b24497abb9d3c81f1b40" and "54b87cb0973040d7a981abe67efa653ea60f9600" have entirely different histories.

14 changed files with 204 additions and 291 deletions

View File

@ -233,10 +233,6 @@ if (WAMR_BUILD_SPEC_TEST EQUAL 1)
add_definitions (-DWASM_ENABLE_SPEC_TEST=1) add_definitions (-DWASM_ENABLE_SPEC_TEST=1)
message (" spec test compatible mode is on") message (" spec test compatible mode is on")
endif () endif ()
if (WAMR_BUILD_WASI_TEST EQUAL 1)
add_definitions (-DWASM_ENABLE_WASI_TEST=1)
message (" wasi test compatible mode is on")
endif ()
if (NOT DEFINED WAMR_BUILD_BULK_MEMORY) if (NOT DEFINED WAMR_BUILD_BULK_MEMORY)
# Enable bulk memory by default # Enable bulk memory by default
set (WAMR_BUILD_BULK_MEMORY 1) set (WAMR_BUILD_BULK_MEMORY 1)

View File

@ -363,10 +363,6 @@
#define WASM_ENABLE_SPEC_TEST 0 #define WASM_ENABLE_SPEC_TEST 0
#endif #endif
#ifndef WASM_ENABLE_WASI_TEST
#define WASM_ENABLE_WASI_TEST 0
#endif
/* Global heap pool size in bytes */ /* Global heap pool size in bytes */
#ifndef WASM_GLOBAL_HEAP_SIZE #ifndef WASM_GLOBAL_HEAP_SIZE
#define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024) #define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024)

View File

@ -1267,9 +1267,6 @@ wasm_runtime_is_built_in_module(const char *module_name)
|| !strcmp("wasi_snapshot_preview1", module_name) || !strcmp("wasi_snapshot_preview1", module_name)
#if WASM_ENABLE_SPEC_TEST != 0 #if WASM_ENABLE_SPEC_TEST != 0
|| !strcmp("spectest", module_name) || !strcmp("spectest", module_name)
#endif
#if WASM_ENABLE_WASI_TEST != 0
|| !strcmp("foo", module_name)
#endif #endif
|| !strcmp("", module_name)); || !strcmp("", module_name));
} }

View File

@ -605,14 +605,6 @@ set_local_gc_ref(AOTCompFrame *frame, int n, LLVMValueRef value, uint8 ref_type)
#define PUSH_PAGE_COUNT(v) \ #define PUSH_PAGE_COUNT(v) \
PUSH(v, MEMORY64_COND_VALUE(VALUE_TYPE_I64, VALUE_TYPE_I32)) PUSH(v, MEMORY64_COND_VALUE(VALUE_TYPE_I64, VALUE_TYPE_I32))
#define SET_CONST(v) \
do { \
AOTValue *aot_value = \
func_ctx->block_stack.block_list_end->value_stack.value_list_end; \
aot_value->is_const = true; \
aot_value->const_value = (v); \
} while (0)
#define TO_LLVM_TYPE(wasm_type) \ #define TO_LLVM_TYPE(wasm_type) \
wasm_type_to_llvm_type(comp_ctx, &comp_ctx->basic_types, wasm_type) wasm_type_to_llvm_type(comp_ctx, &comp_ctx->basic_types, wasm_type)

View File

@ -3038,18 +3038,15 @@ typedef struct elf64_rela {
elf64_sxword r_addend; elf64_sxword r_addend;
} elf64_rela; } elf64_rela;
#define SET_TARGET_INFO_VALUE(f, val, type, little) \ #define SET_TARGET_INFO(f, v, type, little) \
do { \ do { \
type tmp = val; \ type tmp = elf_header->v; \
if ((little && !is_little_endian()) \ if ((little && !is_little_endian()) \
|| (!little && is_little_endian())) \ || (!little && is_little_endian())) \
exchange_##type((uint8 *)&tmp); \ exchange_##type((uint8 *)&tmp); \
obj_data->target_info.f = tmp; \ obj_data->target_info.f = tmp; \
} while (0) } while (0)
#define SET_TARGET_INFO_FIELD(f, v, type, little) \
SET_TARGET_INFO_VALUE(f, elf_header->v, type, little)
static bool static bool
aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data) aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
{ {
@ -3099,7 +3096,6 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
|| bin_type == LLVMBinaryTypeELF32B) { || bin_type == LLVMBinaryTypeELF32B) {
struct elf32_ehdr *elf_header; struct elf32_ehdr *elf_header;
bool is_little_bin = bin_type == LLVMBinaryTypeELF32L; bool is_little_bin = bin_type == LLVMBinaryTypeELF32L;
uint16 e_type;
if (!elf_buf || elf_size < sizeof(struct elf32_ehdr)) { if (!elf_buf || elf_size < sizeof(struct elf32_ehdr)) {
aot_set_last_error("invalid elf32 buffer."); aot_set_last_error("invalid elf32 buffer.");
@ -3107,22 +3103,20 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
} }
elf_header = (struct elf32_ehdr *)elf_buf; elf_header = (struct elf32_ehdr *)elf_buf;
e_type = elf_header->e_type;
/* Emit eXecute In Place file type while in indirect mode */ /* Emit eXecute In Place file type while in indirect mode */
if (comp_ctx->is_indirect_mode) if (comp_ctx->is_indirect_mode)
e_type = E_TYPE_XIP; elf_header->e_type = E_TYPE_XIP;
SET_TARGET_INFO_VALUE(e_type, e_type, uint16, is_little_bin); SET_TARGET_INFO(e_type, e_type, uint16, is_little_bin);
SET_TARGET_INFO_FIELD(e_machine, e_machine, uint16, is_little_bin); SET_TARGET_INFO(e_machine, e_machine, uint16, is_little_bin);
SET_TARGET_INFO_FIELD(e_version, e_version, uint32, is_little_bin); SET_TARGET_INFO(e_version, e_version, uint32, is_little_bin);
SET_TARGET_INFO_FIELD(e_flags, e_flags, uint32, is_little_bin); SET_TARGET_INFO(e_flags, e_flags, uint32, is_little_bin);
} }
else if (bin_type == LLVMBinaryTypeELF64L else if (bin_type == LLVMBinaryTypeELF64L
|| bin_type == LLVMBinaryTypeELF64B) { || bin_type == LLVMBinaryTypeELF64B) {
struct elf64_ehdr *elf_header; struct elf64_ehdr *elf_header;
bool is_little_bin = bin_type == LLVMBinaryTypeELF64L; bool is_little_bin = bin_type == LLVMBinaryTypeELF64L;
uint16 e_type;
if (!elf_buf || elf_size < sizeof(struct elf64_ehdr)) { if (!elf_buf || elf_size < sizeof(struct elf64_ehdr)) {
aot_set_last_error("invalid elf64 buffer."); aot_set_last_error("invalid elf64 buffer.");
@ -3130,16 +3124,15 @@ aot_resolve_target_info(AOTCompContext *comp_ctx, AOTObjectData *obj_data)
} }
elf_header = (struct elf64_ehdr *)elf_buf; elf_header = (struct elf64_ehdr *)elf_buf;
e_type = elf_header->e_type;
/* Emit eXecute In Place file type while in indirect mode */ /* Emit eXecute In Place file type while in indirect mode */
if (comp_ctx->is_indirect_mode) if (comp_ctx->is_indirect_mode)
e_type = E_TYPE_XIP; elf_header->e_type = E_TYPE_XIP;
SET_TARGET_INFO_VALUE(e_type, e_type, uint16, is_little_bin); SET_TARGET_INFO(e_type, e_type, uint16, is_little_bin);
SET_TARGET_INFO_FIELD(e_machine, e_machine, uint16, is_little_bin); SET_TARGET_INFO(e_machine, e_machine, uint16, is_little_bin);
SET_TARGET_INFO_FIELD(e_version, e_version, uint32, is_little_bin); SET_TARGET_INFO(e_version, e_version, uint32, is_little_bin);
SET_TARGET_INFO_FIELD(e_flags, e_flags, uint32, is_little_bin); SET_TARGET_INFO(e_flags, e_flags, uint32, is_little_bin);
} }
else if (bin_type == LLVMBinaryTypeMachO32L else if (bin_type == LLVMBinaryTypeMachO32L
|| bin_type == LLVMBinaryTypeMachO32B) { || bin_type == LLVMBinaryTypeMachO32B) {

View File

@ -28,7 +28,6 @@ aot_compile_op_i32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
} }
PUSH_I32(value); PUSH_I32(value);
SET_CONST((uint64)(uint32)i32_const);
return true; return true;
fail: fail:
return false; return false;
@ -56,7 +55,6 @@ aot_compile_op_i64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
} }
PUSH_I64(value); PUSH_I64(value);
SET_CONST((uint64)i64_const);
return true; return true;
fail: fail:
return false; return false;

View File

@ -107,9 +107,7 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
LLVMBasicBlockRef check_succ; LLVMBasicBlockRef check_succ;
AOTValue *aot_value_top; AOTValue *aot_value_top;
uint32 local_idx_of_aot_value = 0; uint32 local_idx_of_aot_value = 0;
uint64 const_value;
bool is_target_64bit, is_local_of_aot_value = false; bool is_target_64bit, is_local_of_aot_value = false;
bool is_const = false;
#if WASM_ENABLE_SHARED_MEMORY != 0 #if WASM_ENABLE_SHARED_MEMORY != 0
bool is_shared_memory = bool is_shared_memory =
comp_ctx->comp_data->memories[0].flags & SHARED_MEMORY_FLAG; comp_ctx->comp_data->memories[0].flags & SHARED_MEMORY_FLAG;
@ -164,9 +162,7 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
/* aot_value_top is freed in the following POP_I32(addr), /* aot_value_top is freed in the following POP_I32(addr),
so save its fields here for further use */ so save its fields here for further use */
is_local_of_aot_value = aot_value_top->is_local; is_local_of_aot_value = aot_value_top->is_local;
is_const = aot_value_top->is_const;
local_idx_of_aot_value = aot_value_top->local_idx; local_idx_of_aot_value = aot_value_top->local_idx;
const_value = aot_value_top->const_value;
} }
POP_MEM_OFFSET(addr); POP_MEM_OFFSET(addr);
@ -176,15 +172,9 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
* have been thrown when converting float to integer before * have been thrown when converting float to integer before
*/ */
/* return address directly if constant offset and inside memory space */ /* return address directly if constant offset and inside memory space */
if (LLVMIsEfficientConstInt(addr) || is_const) { if (LLVMIsEfficientConstInt(addr)) {
uint64 value; uint64 mem_offset =
if (LLVMIsEfficientConstInt(addr)) { (uint64)LLVMConstIntGetZExtValue(addr) + (uint64)offset;
value = (uint64)LLVMConstIntGetZExtValue(addr);
}
else {
value = const_value;
}
uint64 mem_offset = value + (uint64)offset;
uint32 num_bytes_per_page = uint32 num_bytes_per_page =
comp_ctx->comp_data->memories[0].num_bytes_per_page; comp_ctx->comp_data->memories[0].num_bytes_per_page;
uint32 init_page_count = uint32 init_page_count =

View File

@ -75,12 +75,10 @@ typedef struct AOTValue {
struct AOTValue *next; struct AOTValue *next;
struct AOTValue *prev; struct AOTValue *prev;
LLVMValueRef value; LLVMValueRef value;
uint64 const_value; /* valid if is_const is true */
uint32 local_idx;
/* VALUE_TYPE_I32/I64/F32/F64/VOID */ /* VALUE_TYPE_I32/I64/F32/F64/VOID */
uint8 type; uint8 type;
bool is_local; bool is_local;
bool is_const; uint32 local_idx;
} AOTValue; } AOTValue;
/** /**

View File

@ -2533,7 +2533,6 @@ load_function_import(const uint8 **p_buf, const uint8 *buf_end,
WASMFunction *linked_func = NULL; WASMFunction *linked_func = NULL;
#if WASM_ENABLE_MULTI_MODULE != 0 #if WASM_ENABLE_MULTI_MODULE != 0
WASMModule *sub_module = NULL; WASMModule *sub_module = NULL;
bool is_built_in_module = false;
#endif #endif
const char *linked_signature = NULL; const char *linked_signature = NULL;
void *linked_attachment = NULL; void *linked_attachment = NULL;
@ -2569,16 +2568,17 @@ load_function_import(const uint8 **p_buf, const uint8 *buf_end,
} }
#if WASM_ENABLE_MULTI_MODULE != 0 #if WASM_ENABLE_MULTI_MODULE != 0
else { else {
if (!(is_built_in_module = if (!wasm_runtime_is_built_in_module(sub_module_name)) {
wasm_runtime_is_built_in_module(sub_module_name))) {
sub_module = (WASMModule *)wasm_runtime_load_depended_module( sub_module = (WASMModule *)wasm_runtime_load_depended_module(
(WASMModuleCommon *)parent_module, sub_module_name, error_buf, (WASMModuleCommon *)parent_module, sub_module_name, error_buf,
error_buf_size); error_buf_size);
if (!sub_module) {
return false;
}
} }
if (is_built_in_module || sub_module) linked_func = wasm_loader_resolve_function(
linked_func = wasm_loader_resolve_function( sub_module_name, function_name, declare_func_type, error_buf,
sub_module_name, function_name, declare_func_type, error_buf, error_buf_size);
error_buf_size);
} }
#endif #endif
@ -2691,20 +2691,24 @@ load_table_import(const uint8 **p_buf, const uint8 *buf_end,
sub_module = (WASMModule *)wasm_runtime_load_depended_module( sub_module = (WASMModule *)wasm_runtime_load_depended_module(
(WASMModuleCommon *)parent_module, sub_module_name, error_buf, (WASMModuleCommon *)parent_module, sub_module_name, error_buf,
error_buf_size); error_buf_size);
if (sub_module) { if (!sub_module) {
linked_table = wasm_loader_resolve_table( return false;
sub_module_name, table_name, declare_init_size,
declare_max_size, error_buf, error_buf_size);
if (linked_table) {
/* reset with linked table limit */
declare_elem_type = linked_table->table_type.elem_type;
declare_init_size = linked_table->table_type.init_size;
declare_max_size = linked_table->table_type.max_size;
declare_max_size_flag = linked_table->table_type.flags;
table->import_table_linked = linked_table;
table->import_module = sub_module;
}
} }
linked_table = wasm_loader_resolve_table(
sub_module_name, table_name, declare_init_size, declare_max_size,
error_buf, error_buf_size);
if (!linked_table) {
return false;
}
/* reset with linked table limit */
declare_elem_type = linked_table->table_type.elem_type;
declare_init_size = linked_table->table_type.init_size;
declare_max_size = linked_table->table_type.max_size;
declare_max_size_flag = linked_table->table_type.flags;
table->import_table_linked = linked_table;
table->import_module = sub_module;
} }
#endif /* WASM_ENABLE_MULTI_MODULE != 0 */ #endif /* WASM_ENABLE_MULTI_MODULE != 0 */
@ -2866,19 +2870,31 @@ load_memory_import(const uint8 **p_buf, const uint8 *buf_end,
sub_module = (WASMModule *)wasm_runtime_load_depended_module( sub_module = (WASMModule *)wasm_runtime_load_depended_module(
(WASMModuleCommon *)parent_module, sub_module_name, error_buf, (WASMModuleCommon *)parent_module, sub_module_name, error_buf,
error_buf_size); error_buf_size);
if (sub_module) { if (!sub_module) {
#if WASM_ENABLE_LIB_WASI_THREADS != 0
/* Avoid memory import failure when wasi-threads is enabled
and the memory is shared */
if (!(mem_flag & SHARED_MEMORY_FLAG))
return false;
#else
return false;
#endif /* WASM_ENABLE_LIB_WASI_THREADS */
}
else {
linked_memory = wasm_loader_resolve_memory( linked_memory = wasm_loader_resolve_memory(
sub_module_name, memory_name, declare_init_page_count, sub_module_name, memory_name, declare_init_page_count,
declare_max_page_count, error_buf, error_buf_size); declare_max_page_count, error_buf, error_buf_size);
if (linked_memory) { if (!linked_memory) {
/** return false;
* reset with linked memory limit
*/
memory->import_module = sub_module;
memory->import_memory_linked = linked_memory;
declare_init_page_count = linked_memory->init_page_count;
declare_max_page_count = linked_memory->max_page_count;
} }
/**
* reset with linked memory limit
*/
memory->import_module = sub_module;
memory->import_memory_linked = linked_memory;
declare_init_page_count = linked_memory->init_page_count;
declare_max_page_count = linked_memory->max_page_count;
} }
} }
#endif #endif
@ -2904,29 +2920,6 @@ load_memory_import(const uint8 **p_buf, const uint8 *buf_end,
declare_init_page_count = spectest_memory_init_page; declare_init_page_count = spectest_memory_init_page;
declare_max_page_count = spectest_memory_max_page; declare_max_page_count = spectest_memory_max_page;
} }
#if WASM_ENABLE_WASI_TEST != 0
/* a case in wasi-testsuite which imports ("foo" "bar") */
else if (!strcmp("foo", sub_module_name)) {
uint32 spectest_memory_init_page = 1;
uint32 spectest_memory_max_page = 1;
if (strcmp("bar", memory_name)) {
set_error_buf(error_buf, error_buf_size,
"incompatible import type or unknown import");
return false;
}
if (declare_init_page_count > spectest_memory_init_page
|| declare_max_page_count < spectest_memory_max_page) {
set_error_buf(error_buf, error_buf_size,
"incompatible import type");
return false;
}
declare_init_page_count = spectest_memory_init_page;
declare_max_page_count = spectest_memory_max_page;
}
#endif
/* now we believe all declaration are ok */ /* now we believe all declaration are ok */
memory->mem_type.flags = mem_flag; memory->mem_type.flags = mem_flag;
@ -2990,19 +2983,20 @@ load_tag_import(const uint8 **p_buf, const uint8 *buf_end,
sub_module = (WASMModule *)wasm_runtime_load_depended_module( sub_module = (WASMModule *)wasm_runtime_load_depended_module(
(WASMModuleCommon *)parent_module, sub_module_name, error_buf, (WASMModuleCommon *)parent_module, sub_module_name, error_buf,
error_buf_size); error_buf_size);
if (sub_module) { if (!sub_module) {
/* wasm_loader_resolve_tag checks, that the imported tag return false;
* and the declared tag have the same type }
*/ /* wasm_loader_resolve_tag checks, that the imported tag
uint32 linked_tag_index = 0; * and the declared tag have the same type
WASMTag *linked_tag = wasm_loader_resolve_tag( */
sub_module_name, tag_name, declare_tag_type, uint32 linked_tag_index = 0;
&linked_tag_index /* out */, error_buf, error_buf_size); WASMTag *linked_tag = wasm_loader_resolve_tag(
if (linked_tag) { sub_module_name, tag_name, declare_tag_type,
tag->import_module = sub_module; &linked_tag_index /* out */, error_buf, error_buf_size);
tag->import_tag_linked = linked_tag; if (linked_tag) {
tag->import_tag_index_linked = linked_tag_index; tag->import_module = sub_module;
} tag->import_tag_linked = linked_tag;
tag->import_tag_index_linked = linked_tag_index;
} }
} }
#endif #endif
@ -3101,16 +3095,18 @@ load_global_import(const uint8 **p_buf, const uint8 *buf_end,
sub_module = (WASMModule *)wasm_runtime_load_depended_module( sub_module = (WASMModule *)wasm_runtime_load_depended_module(
(WASMModuleCommon *)parent_module, sub_module_name, error_buf, (WASMModuleCommon *)parent_module, sub_module_name, error_buf,
error_buf_size); error_buf_size);
if (sub_module) { if (!sub_module) {
/* check sub modules */ return false;
linked_global = wasm_loader_resolve_global( }
sub_module_name, global_name, declare_type, declare_mutable,
error_buf, error_buf_size); /* check sub modules */
if (linked_global) { linked_global = wasm_loader_resolve_global(
global->import_module = sub_module; sub_module_name, global_name, declare_type, declare_mutable,
global->import_global_linked = linked_global; error_buf, error_buf_size);
global->is_linked = true; if (linked_global) {
} global->import_module = sub_module;
global->import_global_linked = linked_global;
global->is_linked = true;
} }
} }
#endif #endif

View File

@ -1710,73 +1710,36 @@ check_linked_symbol(WASMModuleInstance *module_inst, char *error_buf,
&& !func->import_func_linked && !func->import_func_linked
#endif #endif
) { ) {
#if WASM_ENABLE_WAMR_COMPILER == 0
LOG_WARNING("warning: failed to link import function (%s, %s)", LOG_WARNING("warning: failed to link import function (%s, %s)",
func->module_name, func->field_name); func->module_name, func->field_name);
/* will throw exception only if calling */
#else
/* do nothing to avoid confused message */
#endif /* WASM_ENABLE_WAMR_COMPILER == 0 */
} }
} }
for (i = 0; i < module->import_global_count; i++) { for (i = 0; i < module->import_global_count; i++) {
WASMGlobalImport *global = &((module->import_globals + i)->u.global); WASMGlobalImport *global = &((module->import_globals + i)->u.global);
if (!global->is_linked) { if (!global->is_linked) {
#if WASM_ENABLE_SPEC_TEST != 0 #if WASM_ENABLE_SPEC_TEST != 0
set_error_buf(error_buf, error_buf_size, set_error_buf(error_buf, error_buf_size,
"unknown import or incompatible import type"); "unknown import or incompatible import type");
return false; return false;
#else #else
#if WASM_ENABLE_WAMR_COMPILER == 0
set_error_buf_v(error_buf, error_buf_size, set_error_buf_v(error_buf, error_buf_size,
"failed to link import global (%s, %s)", "failed to link import global (%s, %s)",
global->module_name, global->field_name); global->module_name, global->field_name);
return false; return false;
#else
/* do nothing to avoid confused message */
#endif /* WASM_ENABLE_WAMR_COMPILER == 0 */
#endif /* WASM_ENABLE_SPEC_TEST != 0 */ #endif /* WASM_ENABLE_SPEC_TEST != 0 */
} }
} }
for (i = 0; i < module->import_table_count; i++) {
WASMTableImport *table = &((module->import_tables + i)->u.table);
if (!wasm_runtime_is_built_in_module(table->module_name)
#if WASM_ENABLE_MULTI_MODULE != 0
&& !table->import_table_linked
#endif
) {
set_error_buf_v(error_buf, error_buf_size,
"failed to link import table (%s, %s)",
table->module_name, table->field_name);
return false;
}
}
for (i = 0; i < module->import_memory_count; i++) {
WASMMemoryImport *memory = &((module->import_memories + i)->u.memory);
if (!wasm_runtime_is_built_in_module(memory->module_name)
#if WASM_ENABLE_MULTI_MODULE != 0
&& !memory->import_memory_linked
#endif
) {
set_error_buf_v(error_buf, error_buf_size,
"failed to link import memory (%s, %s)",
memory->module_name, memory->field_name);
return false;
}
}
#if WASM_ENABLE_MULTI_MODULE != 0
#if WASM_ENABLE_TAGS != 0
for (i = 0; i < module->import_tag_count; i++) {
WASMTagImport *tag = &((module->import_tags + i)->u.tag);
if (!tag->import_tag_linked) {
set_error_buf_v(error_buf, error_buf_size,
"failed to link import tag (%s, %s)",
tag->module_name, tag->field_name);
return false;
}
}
#endif /* WASM_ENABLE_TAGS != 0 */
#endif
return true; return true;
} }

View File

@ -1,5 +1,5 @@
diff --git a/test/core/data.wast b/test/core/data.wast diff --git a/test/core/data.wast b/test/core/data.wast
index b1e12397..a0f69676 100644 index b1e1239..a0f6967 100644
--- a/test/core/data.wast --- a/test/core/data.wast
+++ b/test/core/data.wast +++ b/test/core/data.wast
@@ -312,7 +312,8 @@ @@ -312,7 +312,8 @@
@ -10,7 +10,7 @@ index b1e12397..a0f69676 100644
+ ;; TODO: restore after supporting multi memory" + ;; TODO: restore after supporting multi memory"
+ "unknown memory" + "unknown memory"
) )
;; Data segment with memory index 0 (no memory section) ;; Data segment with memory index 0 (no memory section)
@@ -334,7 +335,8 @@ @@ -334,7 +335,8 @@
"\02\01\41\00\0b" ;; active data segment 0 for memory 1 "\02\01\41\00\0b" ;; active data segment 0 for memory 1
@ -20,7 +20,7 @@ index b1e12397..a0f69676 100644
+ ;; TODO: restore after supporting multi memory" + ;; TODO: restore after supporting multi memory"
+ "unknown memory" + "unknown memory"
) )
;; Data segment with memory index 1 and vec(byte) as above, ;; Data segment with memory index 1 and vec(byte) as above,
@@ -354,7 +356,8 @@ @@ -354,7 +356,8 @@
"\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f" "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
@ -30,7 +30,7 @@ index b1e12397..a0f69676 100644
+ ;; TODO: restore after supporting multi memory" + ;; TODO: restore after supporting multi memory"
+ "unknown memory" + "unknown memory"
) )
;; Data segment with memory index 1 and specially crafted vec(byte) after. ;; Data segment with memory index 1 and specially crafted vec(byte) after.
@@ -374,7 +377,8 @@ @@ -374,7 +377,8 @@
"\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f" "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
@ -40,70 +40,90 @@ index b1e12397..a0f69676 100644
+ ;; TODO: restore after supporting multi memory" + ;; TODO: restore after supporting multi memory"
+ "unknown memory" + "unknown memory"
) )
diff --git a/test/core/elem.wast b/test/core/elem.wast diff --git a/test/core/elem.wast b/test/core/elem.wast
index 4a399eca..3da365e5 100644 index 33b3f67..c72431c 100644
--- a/test/core/elem.wast --- a/test/core/elem.wast
+++ b/test/core/elem.wast +++ b/test/core/elem.wast
@@ -594,6 +594,7 @@ @@ -595,9 +595,11 @@
(assert_return (invoke $module1 "call-8") (i32.const 65)) (func $const-i32-d (type $out-i32) (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) )
+(; +(;
(module $module2
(type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref))
@@ -606,7 +607,9 @@
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 68)) (assert_return (invoke $module1 "call-8") (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) (assert_return (invoke $module1 "call-9") (i32.const 66))
+;) +;)
+(;
(module $module3 (module $module3
(type $out-i32 (func (result i32))) (type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref)) @@ -608,9 +610,11 @@
@@ -619,6 +622,7 @@ (func $const-i32-f (type $out-i32) (i32.const 70))
)
+(;
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 69)) (assert_return (invoke $module1 "call-8") (i32.const 69))
(assert_return (invoke $module1 "call-9") (i32.const 70)) (assert_return (invoke $module1 "call-9") (i32.const 70))
+;) +;)
;; Element segments must match element type of table ;; Element segments must match element type of table
@@ -651,6 +655,7 @@ @@ -643,6 +647,7 @@
;; Initializing a table with an externref-type element segment ;; Initializing a table with an externref-type element segment
+(; +(;
(module $m (module $m
(table $t (export "table") 2 externref) (table $t (export "table") 2 externref)
(func (export "get") (param $i i32) (result externref) (func (export "get") (param $i i32) (result externref)
@@ -675,9 +680,11 @@ @@ -667,9 +672,11 @@
(assert_return (invoke $m "get" (i32.const 0)) (ref.null extern)) (assert_return (invoke $m "get" (i32.const 0)) (ref.null extern))
(assert_return (invoke $m "get" (i32.const 1)) (ref.extern 137)) (assert_return (invoke $m "get" (i32.const 1)) (ref.extern 137))
+;) +;)
;; Initializing a table with imported funcref global ;; Initializing a table with imported funcref global
+(; +(;
(module $module4 (module $module4
(func (result i32) (func (result i32)
i32.const 42 i32.const 42
@@ -698,3 +705,4 @@ @@ -690,3 +697,4 @@
) )
(assert_return (invoke "call_imported_elem") (i32.const 42)) (assert_return (invoke "call_imported_elem") (i32.const 42))
+;) +;)
\ No newline at end of file
diff --git a/test/core/try_catch.wast b/test/core/try_catch.wast
index 2a0e9ff6..f243489d 100644
--- a/test/core/try_catch.wast
+++ b/test/core/try_catch.wast
@@ -203,7 +203,6 @@
(assert_return (invoke "catch-param-i32" (i32.const 5)) (i32.const 5))
-(assert_return (invoke "catch-imported") (i32.const 2))
(assert_return (invoke "catchless-try" (i32.const 0)) (i32.const 0))
(assert_return (invoke "catchless-try" (i32.const 1)) (i32.const 1))
@@ -231,7 +230,6 @@
)
)
-(assert_return (invoke "imported-mismatch") (i32.const 3))
(assert_malformed
(module quote "(module (func (catch_all)))")
diff --git a/test/core/ref_func.wast b/test/core/ref_func.wast diff --git a/test/core/ref_func.wast b/test/core/ref_func.wast
index adb5cb78..6396013b 100644 index adb5cb7..6396013 100644
--- a/test/core/ref_func.wast --- a/test/core/ref_func.wast
+++ b/test/core/ref_func.wast +++ b/test/core/ref_func.wast
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
(register "M") (register "M")
(module (module
- (func $f (import "M" "f") (param i32) (result i32)) - (func $f (import "M" "f") (param i32) (result i32))
+ (func $f (param $x i32) (result i32) (local.get $x)) + (func $f (param $x i32) (result i32) (local.get $x))
@ -111,11 +131,11 @@ index adb5cb78..6396013b 100644
(i32.add (local.get $x) (i32.const 1)) (i32.add (local.get $x) (i32.const 1))
) )
diff --git a/test/core/table_copy.wast b/test/core/table_copy.wast diff --git a/test/core/table_copy.wast b/test/core/table_copy.wast
index 380e84ee..59230cfb 100644 index 380e84e..59230cf 100644
--- a/test/core/table_copy.wast --- a/test/core/table_copy.wast
+++ b/test/core/table_copy.wast +++ b/test/core/table_copy.wast
@@ -14,11 +14,11 @@ @@ -14,11 +14,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -132,7 +152,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -106,11 +106,11 @@ @@ -106,11 +106,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -149,7 +169,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -198,11 +198,11 @@ @@ -198,11 +198,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -166,7 +186,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -290,11 +290,11 @@ @@ -290,11 +290,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -183,7 +203,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -382,11 +382,11 @@ @@ -382,11 +382,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -200,7 +220,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -474,11 +474,11 @@ @@ -474,11 +474,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -217,7 +237,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -566,11 +566,11 @@ @@ -566,11 +566,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -234,7 +254,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -658,11 +658,11 @@ @@ -658,11 +658,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -251,7 +271,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -750,11 +750,11 @@ @@ -750,11 +750,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -268,7 +288,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -842,11 +842,11 @@ @@ -842,11 +842,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -285,7 +305,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -934,11 +934,11 @@ @@ -934,11 +934,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -302,7 +322,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1026,11 +1026,11 @@ @@ -1026,11 +1026,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -319,7 +339,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1118,11 +1118,11 @@ @@ -1118,11 +1118,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -336,7 +356,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1210,11 +1210,11 @@ @@ -1210,11 +1210,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -353,7 +373,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1302,11 +1302,11 @@ @@ -1302,11 +1302,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -370,7 +390,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1394,11 +1394,11 @@ @@ -1394,11 +1394,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -387,7 +407,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1486,11 +1486,11 @@ @@ -1486,11 +1486,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -404,7 +424,7 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -1578,11 +1578,11 @@ @@ -1578,11 +1578,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -421,11 +441,11 @@ index 380e84ee..59230cfb 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
diff --git a/test/core/table_init.wast b/test/core/table_init.wast diff --git a/test/core/table_init.wast b/test/core/table_init.wast
index 0b2d26f7..3c595e5b 100644 index 0b2d26f..3c595e5 100644
--- a/test/core/table_init.wast --- a/test/core/table_init.wast
+++ b/test/core/table_init.wast +++ b/test/core/table_init.wast
@@ -14,11 +14,11 @@ @@ -14,11 +14,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -442,7 +462,7 @@ index 0b2d26f7..3c595e5b 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -72,11 +72,11 @@ @@ -72,11 +72,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -459,7 +479,7 @@ index 0b2d26f7..3c595e5b 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -130,11 +130,11 @@ @@ -130,11 +130,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -476,7 +496,7 @@ index 0b2d26f7..3c595e5b 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t0) (i32.const 2) func 3 1 4 1) (elem (table $t0) (i32.const 2) func 3 1 4 1)
@@ -196,11 +196,11 @@ @@ -196,11 +196,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -493,7 +513,7 @@ index 0b2d26f7..3c595e5b 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -254,11 +254,11 @@ @@ -254,11 +254,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -510,7 +530,7 @@ index 0b2d26f7..3c595e5b 100644
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
@@ -312,11 +312,11 @@ @@ -312,11 +312,11 @@
(module (module
(type (func (result i32))) ;; type #0 (type (func (result i32))) ;; type #0
- (import "a" "ef0" (func (result i32))) ;; index 0 - (import "a" "ef0" (func (result i32))) ;; index 0
@ -526,23 +546,3 @@ index 0b2d26f7..3c595e5b 100644
(table $t0 30 30 funcref) (table $t0 30 30 funcref)
(table $t1 30 30 funcref) (table $t1 30 30 funcref)
(elem (table $t1) (i32.const 2) func 3 1 4 1) (elem (table $t1) (i32.const 2) func 3 1 4 1)
diff --git a/test/core/try_catch.wast b/test/core/try_catch.wast
index 2a0e9ff6..f243489d 100644
--- a/test/core/try_catch.wast
+++ b/test/core/try_catch.wast
@@ -203,7 +203,6 @@
(assert_return (invoke "catch-param-i32" (i32.const 5)) (i32.const 5))
-(assert_return (invoke "catch-imported") (i32.const 2))
(assert_return (invoke "catchless-try" (i32.const 0)) (i32.const 0))
(assert_return (invoke "catchless-try" (i32.const 1)) (i32.const 1))
@@ -231,7 +230,6 @@
)
)
-(assert_return (invoke "imported-mismatch") (i32.const 3))
(assert_malformed
(module quote "(module (func (catch_all)))")

View File

@ -43,28 +43,26 @@ index b1e1239..a0f6967 100644
diff --git a/test/core/elem.wast b/test/core/elem.wast diff --git a/test/core/elem.wast b/test/core/elem.wast
index 33b3f67..a4c1a2d 100644 index 33b3f67..c72431c 100644
--- a/test/core/elem.wast --- a/test/core/elem.wast
+++ b/test/core/elem.wast +++ b/test/core/elem.wast
@@ -586,6 +586,7 @@ @@ -595,9 +595,11 @@
(assert_return (invoke $module1 "call-8") (i32.const 65)) (func $const-i32-d (type $out-i32) (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) )
+(; +(;
(module $module2
(type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref))
@@ -598,7 +599,9 @@
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 68)) (assert_return (invoke $module1 "call-8") (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) (assert_return (invoke $module1 "call-9") (i32.const 66))
+;) +;)
+(;
(module $module3 (module $module3
(type $out-i32 (func (result i32))) (type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref)) @@ -608,9 +610,11 @@
@@ -611,6 +614,7 @@ (func $const-i32-f (type $out-i32) (i32.const 70))
)
+(;
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 69)) (assert_return (invoke $module1 "call-8") (i32.const 69))
(assert_return (invoke $module1 "call-9") (i32.const 70)) (assert_return (invoke $module1 "call-9") (i32.const 70))
@ -97,6 +95,7 @@ index 33b3f67..a4c1a2d 100644
(assert_return (invoke "call_imported_elem") (i32.const 42)) (assert_return (invoke "call_imported_elem") (i32.const 42))
+;) +;)
\ No newline at end of file
diff --git a/test/core/if.wast b/test/core/if.wast diff --git a/test/core/if.wast b/test/core/if.wast
index 2ea45f6..6f07304 100644 index 2ea45f6..6f07304 100644
--- a/test/core/if.wast --- a/test/core/if.wast

View File

@ -70,10 +70,10 @@ index 4090b2c..18f66b4 100644
;; Start section ;; Start section
(module binary (module binary
diff --git a/test/core/data.wast b/test/core/data.wast diff --git a/test/core/data.wast b/test/core/data.wast
index 4f339be..0b5b3e6 100644 index b1e1239..74a7b04 100644
--- a/test/core/data.wast --- a/test/core/data.wast
+++ b/test/core/data.wast +++ b/test/core/data.wast
@@ -306,9 +306,10 @@ @@ -312,9 +312,10 @@
"\02\01\41\00\0b" ;; active data segment 0 for memory 1 "\02\01\41\00\0b" ;; active data segment 0 for memory 1
"\00" ;; empty vec(byte) "\00" ;; empty vec(byte)
) )
@ -85,7 +85,7 @@ index 4f339be..0b5b3e6 100644
;; Data segment with memory index 0 (no memory section) ;; Data segment with memory index 0 (no memory section)
(assert_invalid (assert_invalid
(module binary (module binary
@@ -317,7 +318,7 @@ @@ -323,7 +324,7 @@
"\00\41\00\0b" ;; active data segment 0 for memory 0 "\00\41\00\0b" ;; active data segment 0 for memory 0
"\00" ;; empty vec(byte) "\00" ;; empty vec(byte)
) )
@ -94,7 +94,7 @@ index 4f339be..0b5b3e6 100644
) )
;; Data segment with memory index 1 (no memory section) ;; Data segment with memory index 1 (no memory section)
@@ -328,7 +329,7 @@ @@ -334,7 +335,7 @@
"\02\01\41\00\0b" ;; active data segment 0 for memory 1 "\02\01\41\00\0b" ;; active data segment 0 for memory 1
"\00" ;; empty vec(byte) "\00" ;; empty vec(byte)
) )
@ -103,7 +103,7 @@ index 4f339be..0b5b3e6 100644
) )
;; Data segment with memory index 1 and vec(byte) as above, ;; Data segment with memory index 1 and vec(byte) as above,
@@ -348,7 +349,7 @@ @@ -354,7 +355,7 @@
"\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f" "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
"\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d" "\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d"
) )
@ -112,7 +112,7 @@ index 4f339be..0b5b3e6 100644
) )
;; Data segment with memory index 1 and specially crafted vec(byte) after. ;; Data segment with memory index 1 and specially crafted vec(byte) after.
@@ -368,8 +369,9 @@ @@ -374,8 +375,9 @@
"\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f" "\20\21\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f"
"\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d" "\30\31\32\33\34\35\36\37\38\39\3a\3b\3c\3d"
) )
@ -124,28 +124,26 @@ index 4f339be..0b5b3e6 100644
;; Invalid offsets ;; Invalid offsets
diff --git a/test/core/elem.wast b/test/core/elem.wast diff --git a/test/core/elem.wast b/test/core/elem.wast
index 575ecef..dd1106c 100644 index 575ecef..6eecab9 100644
--- a/test/core/elem.wast --- a/test/core/elem.wast
+++ b/test/core/elem.wast +++ b/test/core/elem.wast
@@ -562,6 +562,7 @@ @@ -571,9 +571,11 @@
(assert_return (invoke $module1 "call-8") (i32.const 65)) (func $const-i32-d (type $out-i32) (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) )
+(; +(;
(module $module2
(type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref))
@@ -574,7 +575,9 @@
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 68)) (assert_return (invoke $module1 "call-8") (i32.const 68))
(assert_return (invoke $module1 "call-9") (i32.const 66)) (assert_return (invoke $module1 "call-9") (i32.const 66))
+;) +;)
+(;
(module $module3 (module $module3
(type $out-i32 (func (result i32))) (type $out-i32 (func (result i32)))
(import "module1" "shared-table" (table 10 funcref)) @@ -584,6 +586,8 @@
@@ -587,3 +590,4 @@ (func $const-i32-f (type $out-i32) (i32.const 70))
)
+(;
(assert_return (invoke $module1 "call-7") (i32.const 67)) (assert_return (invoke $module1 "call-7") (i32.const 67))
(assert_return (invoke $module1 "call-8") (i32.const 69)) (assert_return (invoke $module1 "call-8") (i32.const 69))
(assert_return (invoke $module1 "call-9") (i32.const 70)) (assert_return (invoke $module1 "call-9") (i32.const 70))

View File

@ -998,9 +998,6 @@ function trigger()
# if we're running the wasi certification tests. # if we're running the wasi certification tests.
if [[ $TEST_CASE_ARR ]]; then if [[ $TEST_CASE_ARR ]]; then
for test in "${TEST_CASE_ARR[@]}"; do for test in "${TEST_CASE_ARR[@]}"; do
if [[ "$test" == "wasi_certification" ]]; then
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_WASI_TEST=1"
fi
if [[ "$test" == "wasi_certification" if [[ "$test" == "wasi_certification"
|| "$test" == "standalone" ]]; then || "$test" == "standalone" ]]; then
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1" EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1"