commit 20bcdab462dc21dc912da3ce4deb432a81cbc3c5 (tree)
parent a0ca30ce014f4abd9d31ea335e8860fd1b110495
Author: Vexu <git@vexu.eu>
Date: Sat, 30 Nov 2019 19:14:45 +0200
correct caching and add test for missing fn name
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/codegen.cpp b/src/codegen.cpp
@@ -8459,6 +8459,8 @@ static Error define_builtin_compile_vars(CodeGen *g) {
cache_buf(&cache_hash, compiler_id);
cache_int(&cache_hash, g->build_mode);
cache_bool(&cache_hash, g->strip_debug_symbols);
+ cache_int(&cache_hash, g->out_type);
+ cache_bool(&cache_hash, g->is_dynamic);
cache_bool(&cache_hash, g->is_test_build);
cache_bool(&cache_hash, g->is_single_threaded);
cache_int(&cache_hash, g->zig_target->is_native);
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
@@ -6,6 +6,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\export async fn foo() void {}
, "tmp.zig:1:1: error: exported function cannot be async");
+ cases.addExe(
+ "main missing name",
+ \\pub fn (main) void {}
+ ,
+ "tmp.zig:1:5: error: missing function name",
+ );
+
cases.addCase(x: {
var tc = cases.create("@newStackCall on unsupported target",
\\export fn entry() void {