From: Brendan Hansen Date: Tue, 10 Jan 2023 20:56:57 +0000 (-0600) Subject: only 4 failing test cases now X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=f8bcb534588e7592ae4fff5158c2e60915e13641;p=onyx.git only 4 failing test cases now --- diff --git a/compiler/src/types.c b/compiler/src/types.c index 6a560376..db6d5b70 100644 --- a/compiler/src/types.c +++ b/compiler/src/types.c @@ -919,6 +919,14 @@ void build_linear_types_with_offset(Type* type, bh_arr(TypeWithOffset)* pdest, u 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; diff --git a/compiler/src/wasm_emit.c b/compiler/src/wasm_emit.c index e4cf230e..1855cdc6 100644 --- a/compiler/src/wasm_emit.c +++ b/compiler/src/wasm_emit.c @@ -3964,11 +3964,7 @@ static i32 generate_type_idx(OnyxWasmModule* mod, Type* ft) { 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]); } diff --git a/core/container/heap.onyx b/core/container/heap.onyx index d05e6ac3..2dcecc08 100644 --- a/core/container/heap.onyx +++ b/core/container/heap.onyx @@ -56,7 +56,9 @@ remove_top :: (use heap: ^Heap) -> heap.T { } 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; } @@ -70,7 +72,9 @@ remove_top :: (use heap: ^Heap) -> heap.T { 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; } } diff --git a/interpreter/build.sh b/interpreter/build.sh index d311e432..c58d91f5 100755 --- a/interpreter/build.sh +++ b/interpreter/build.sh @@ -2,9 +2,9 @@ . ../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" diff --git a/scripts/run_tests.onyx b/scripts/run_tests.onyx index 20771bee..60790cfb 100644 --- a/scripts/run_tests.onyx +++ b/scripts/run_tests.onyx @@ -96,10 +96,17 @@ main :: (args) => { 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"; @@ -150,12 +157,21 @@ main :: (args) => { 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 { diff --git a/shared/lib/linux_x86_64/lib/libovmwasm.so b/shared/lib/linux_x86_64/lib/libovmwasm.so index 23b9203a..9368eae7 100755 Binary files a/shared/lib/linux_x86_64/lib/libovmwasm.so and b/shared/lib/linux_x86_64/lib/libovmwasm.so differ diff --git a/tests/parallel_for b/tests/parallel_for deleted file mode 100644 index fbdf9320..00000000 --- a/tests/parallel_for +++ /dev/null @@ -1 +0,0 @@ -49995000