Skip to content

Commit

Permalink
Make codegen tests run smoothly (#1533)
Browse files Browse the repository at this point in the history
- Use a default file name for debug information when we compile from a
string and have no input file name
- Make sure to reach `None` in the fake builtin package for the tests
- Set verbosity to quiet during tests
  • Loading branch information
Benoit Vey authored and jemc committed Jan 26, 2017
1 parent e691987 commit 9739cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libponyc/codegen/gentype.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ static void make_debug_info(compile_t* c, reach_type_t* t)
else
source = ast_source(t->ast);

t->di_file = LLVMDIBuilderCreateFile(c->di, source->file);
const char* file = source->file;
if(file == NULL)
file = "";

t->di_file = LLVMDIBuilderCreateFile(c->di, file);

switch(t->underlying)
{
Expand Down
2 changes: 2 additions & 0 deletions test/libponyc/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static const char* _builtin =
"type Float is (F32 | F64)\n"
"trait val Real[A: Real[A] val]\n"
"class val Env\n"
" let none: None = None\n"
"primitive None\n"
"primitive Bool\n"
"class val String\n"
Expand Down Expand Up @@ -209,6 +210,7 @@ void PassTest::SetUp()
_first_pkg_path = "prog";
package_clear_magic();
package_suppress_build_message();
opt.verbosity = VERBOSITY_QUIET;
}


Expand Down

0 comments on commit 9739cad

Please sign in to comment.