Avoid forward declaring the entry point without actually defining it
This commit is contained in:
parent
734537a528
commit
dc85a8b296
@ -37,6 +37,11 @@ void IRBuilder::create_program(std::shared_ptr<ProgramNode> program)
|
|||||||
{
|
{
|
||||||
Error::throw_error_without_location(format_string("Missing entry point: %s", Arguments::values["entry"]));
|
Error::throw_error_without_location(format_string("Missing entry point: %s", Arguments::values["entry"]));
|
||||||
}
|
}
|
||||||
|
if (module->getFunction(Arguments::values["entry"])->empty())
|
||||||
|
{
|
||||||
|
Error::throw_error_without_location(
|
||||||
|
format_string("Entry point %s has no body", Arguments::values["entry"]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"file": "declare-main.sp",
|
"file": "declare-main.sp",
|
||||||
"compile": {
|
"compile": {
|
||||||
"flags": [],
|
"flags": [],
|
||||||
"exit-code": 0,
|
"exit-code": 1,
|
||||||
"stdout": "",
|
"stdout": "",
|
||||||
"stderr": ""
|
"stderr": "\u001b[1;1m\u001b[31;49merror: \u001b[0;0mEntry point main has no body\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user