build_linear_types_with_offset(type->Compound.types[i], pdest, offset + elem_offset);
elem_offset += bh_max(type_size_of(type->Compound.types[i]), 4);
}
+
+ } else if (type->kind == Type_Kind_Slice || type->kind == Type_Kind_VarArgs) {
+ u32 mem_count = type_structlike_mem_count(type);
+ StructMember smem = { 0 };
+ fori (i, 0, mem_count) {
+ type_lookup_member_by_idx(type, i, &smem);
+ build_linear_types_with_offset(smem.type, pdest, offset + smem.offset);
+ }
} else {
bh_arr(TypeWithOffset) dest = *pdest;
i32 params_left = param_count;
while (params_left-- > 0) {
- if ((*param_type)->kind == Type_Kind_Struct) {
- *(t++) = (char) onyx_type_to_wasm_type(*param_type);
- }
-
- else if (type_get_param_pass(*param_type) == Param_Pass_By_Implicit_Pointer) {
+ if (type_get_param_pass(*param_type) == Param_Pass_By_Implicit_Pointer) {
*(t++) = (char) onyx_type_to_wasm_type(&basic_types[Basic_Kind_Rawptr]);
}
}
if idx != min_index {
- data[min_index], data[idx] = data[idx], data[min_index];
+ tmp := data[idx];
+ data[idx] = data[min_index];
+ data[min_index] = tmp;
idx = min_index;
continue;
}
parent := heap_parent(idx);
if compare(data[parent], data[idx]) <= 0 do break;
- data[parent], data[idx] = data[idx], data[parent];
+ tmp := data[parent];
+ data[parent] = data[idx];
+ data[idx] = tmp;
idx = parent;
}
}
. ../settings.sh
-FLAGS="-g3 -O2 -DOVM_DEBUG=1"
+# FLAGS="-g3 -O2 -DOVM_DEBUG=1"
# FLAGS="-g3 -DOVM_VERBOSE=1"
-# FLAGS="-Ofast -fno-stack-protector"
+FLAGS="-Ofast -fno-stack-protector"
LIBS="-pthread"
TARGET="../shared/lib/linux_$(uname -m)/lib/libovmwasm.so"
C_FILES="src/wasm.c src/vm/*.c src/wasm/*.c src/debug/*.c"
onyx_cmd: str;
at_least_one_test_failed := false;
compile_only := false; // @Bug // why is this necessary? why is settings.compile_only false when in the thread code?
+
+ failed_tests: ^[..] str;
+ failed_tests_mutex: sync.Mutex;
}
exec_context := init(Execution_Context);
exec_context.compile_only = settings.compile_only;
+ failed_tests := make([..] str);
+ exec_context.failed_tests = ^failed_tests;
+ sync.mutex_init(^exec_context.failed_tests_mutex);
+
switch runtime.compiler_os {
case .Linux {
exec_context.onyx_cmd = "./bin/onyx";
printf("Expected:\n{}\n", expected_output);
printf("Got:\n{}\n", output);
thread_data.at_least_one_test_failed = true;
+
+ sync.critical_section(^thread_data.failed_tests_mutex) {
+ array.push(thread_data.failed_tests, it.source_file);
+ }
}
}
}
if exec_context.at_least_one_test_failed {
print_color(.Red, "FAILED\n");
+
+ for failed_tests {
+ printf(" {}\n", it);
+ }
+
os.exit(-1);
} else {