authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-30 19:14:45+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-03 12:50:41-05:00
log20bcdab462dc21dc912da3ce4deb432a81cbc3c5
treeb1cdd674cfbe448e5563f8f63c39a0c84ffbd909
parenta0ca30ce014f4abd9d31ea335e8860fd1b110495
signature Commit is signed but in an unrecognized format.

correct caching and add test for missing fn name


2 files changed, 9 insertions(+), 0 deletions(-)

src/codegen.cpp+2
...@@ -8459,6 +8459,8 @@ static Error define_builtin_compile_vars(CodeGen *g) {...@@ -8459,6 +8459,8 @@ static Error define_builtin_compile_vars(CodeGen *g) {
8459 cache_buf(&cache_hash, compiler_id);8459 cache_buf(&cache_hash, compiler_id);
8460 cache_int(&cache_hash, g->build_mode);8460 cache_int(&cache_hash, g->build_mode);
8461 cache_bool(&cache_hash, g->strip_debug_symbols);8461 cache_bool(&cache_hash, g->strip_debug_symbols);
8462 cache_int(&cache_hash, g->out_type);
8463 cache_bool(&cache_hash, g->is_dynamic);
8462 cache_bool(&cache_hash, g->is_test_build);8464 cache_bool(&cache_hash, g->is_test_build);
8463 cache_bool(&cache_hash, g->is_single_threaded);8465 cache_bool(&cache_hash, g->is_single_threaded);
8464 cache_int(&cache_hash, g->zig_target->is_native);8466 cache_int(&cache_hash, g->zig_target->is_native);
test/compile_errors.zig+7
...@@ -6,6 +6,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -6,6 +6,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
6 \\export async fn foo() void {}6 \\export async fn foo() void {}
7 , "tmp.zig:1:1: error: exported function cannot be async");7 , "tmp.zig:1:1: error: exported function cannot be async");
88
9 cases.addExe(
10 "main missing name",
11 \\pub fn (main) void {}
12 ,
13 "tmp.zig:1:5: error: missing function name",
14 );
15
9 cases.addCase(x: {16 cases.addCase(x: {
10 var tc = cases.create("@newStackCall on unsupported target",17 var tc = cases.create("@newStackCall on unsupported target",
11 \\export fn entry() void {18 \\export fn entry() void {