diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-17 18:50:30 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-17 18:50:30 +0000 |
| commit | 2bd0fd932a4eb1c2e6bc8702450c230186bb3c44 (patch) | |
| tree | 7f3441c0de7036aaa3f67aaa1edf4f610984f35c /src/ir.cpp | |
| parent | 11577db6a84d17998478dc22b607a203cdf00a7e (diff) | |
Begin rudimentary work on implementing `odin test` tooling with `*_test.odin` files
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 1f2819ccf..819442030 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -12781,11 +12781,18 @@ void ir_gen_tree(irGen *s) { ir_fill_slice(proc, global_args, argv, ir_emit_conv(proc, argc, t_int)); ir_emit(proc, ir_alloc_instr(proc, irInstr_StartupRuntime)); - { + Array<irValue *> empty_args = {}; + if (build_context.command_kind == Command_test) { + for_array(i, m->info->testing_procedures) { + Entity *e = m->info->testing_procedures[i]; + irValue **found = map_get(&proc->module->values, hash_entity(e)); + GB_ASSERT(found != nullptr); + ir_emit_call(proc, *found, empty_args); + } + } else { irValue **found = map_get(&proc->module->values, hash_entity(entry_point)); if (found != nullptr) { - Array<irValue *> args = {}; - ir_emit_call(proc, *found, args); + ir_emit_call(proc, *found, empty_args); } } |