Begin rudimentary work on implementing odin test tooling with *_test.odin files

This commit is contained in:
gingerBill
2020-11-17 18:50:30 +00:00
parent 11577db6a8
commit 2bd0fd932a
7 changed files with 102 additions and 16 deletions
+14 -4
View File
@@ -12875,11 +12875,21 @@ void lb_generate_code(lbGenerator *gen) {
lb_begin_procedure_body(p);
lbValue *found = map_get(&m->values, hash_entity(entry_point));
GB_ASSERT(found != nullptr);
LLVMBuildCall2(p->builder, LLVMGetElementType(lb_type(m, startup_runtime->type)), startup_runtime->value, nullptr, 0, "");
LLVMBuildCall2(p->builder, LLVMGetElementType(lb_type(m, found->type)), found->value, nullptr, 0, "");
if (build_context.command_kind == Command_test) {
for_array(i, m->info->testing_procedures) {
Entity *e = m->info->testing_procedures[i];
lbValue *found = map_get(&m->values, hash_entity(e));
GB_ASSERT(found != nullptr);
lb_emit_call(p, *found, {});
}
} else {
lbValue *found = map_get(&m->values, hash_entity(entry_point));
GB_ASSERT(found != nullptr);
LLVMBuildCall2(p->builder, LLVMGetElementType(lb_type(m, found->type)), found->value, nullptr, 0, "");
}
LLVMBuildRet(p->builder, LLVMConstInt(lb_type(m, t_i32), 0, false));
lb_end_procedure_body(p);