| author | |
| committer | |
| log | 134853f1068624dfda4be0feadd653ed3ee92cc3 |
| tree | a761ad1fbfb7b6841caca03f5dcfc0723d01312f |
| parent | 579694893ee082ed829b017694fece4e7f41946f |
3 files changed, 18 insertions(+), 6 deletions(-)
BRANCH_TODO+6| ... | ... | @@ -1,4 +1,10 @@ |
| 1 | 1 | * get stage2 tests passing |
| 2 | - after the error from an empty file, "has no member main" is invalidated | |
| 3 | but the comptime block incorrectly does not get re-run | |
| 4 | - redundant comptime wrong source loc | |
| 5 | - redeclaration of 'foo' not showing 'previously declared here' | |
| 6 | - segfault in one of the tests | |
| 7 | - memory leaks | |
| 2 | 8 | * modify stage2 tests so that only 1 uses _start and the rest use |
| 3 | 9 | pub fn main |
| 4 | 10 | * modify stage2 CBE tests so that only 1 uses pub export main and the |
test/stage2/darwin.zig+6-2| ... | ... | @@ -13,13 +13,17 @@ pub fn addCases(ctx: *TestContext) !void { |
| 13 | 13 | }; |
| 14 | 14 | { |
| 15 | 15 | var case = ctx.exe("hello world with updates", target); |
| 16 | case.addError("", &[_][]const u8{"error: no entry point found"}); | |
| 16 | case.addError("", &[_][]const u8{ | |
| 17 | ":84:9: error: struct 'test_case.test_case' has no member named 'main'", | |
| 18 | }); | |
| 17 | 19 | |
| 18 | 20 | // Incorrect return type |
| 19 | 21 | case.addError( |
| 20 | 22 | \\pub export fn _start() noreturn { |
| 21 | 23 | \\} |
| 22 | , &[_][]const u8{":2:1: error: expected noreturn, found void"}); | |
| 24 | , &[_][]const u8{ | |
| 25 | ":2:1: error: expected noreturn, found void", | |
| 26 | }); | |
| 23 | 27 | |
| 24 | 28 | // Regular old hello world |
| 25 | 29 | case.addCompareOutput( |
test/stage2/test.zig+6-4| ... | ... | @@ -24,7 +24,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 24 | 24 | { |
| 25 | 25 | var case = ctx.exe("hello world with updates", linux_x64); |
| 26 | 26 | |
| 27 | case.addError("", &[_][]const u8{"error: no entry point found"}); | |
| 27 | case.addError("", &[_][]const u8{ | |
| 28 | ":84:9: error: struct 'test_case.test_case' has no member named 'main'", | |
| 29 | }); | |
| 28 | 30 | |
| 29 | 31 | // Incorrect return type |
| 30 | 32 | case.addError( |
| ... | ... | @@ -321,7 +323,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 321 | 323 | { |
| 322 | 324 | var case = ctx.exe("multiplying numbers at runtime and comptime", linux_x64); |
| 323 | 325 | case.addCompareOutput( |
| 324 | \\export fn _start() noreturn { | |
| 326 | \\pub export fn _start() noreturn { | |
| 325 | 327 | \\ mul(3, 4); |
| 326 | 328 | \\ |
| 327 | 329 | \\ exit(); |
| ... | ... | @@ -345,7 +347,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 345 | 347 | ); |
| 346 | 348 | // comptime function call |
| 347 | 349 | case.addCompareOutput( |
| 348 | \\export fn _start() noreturn { | |
| 350 | \\pub export fn _start() noreturn { | |
| 349 | 351 | \\ exit(); |
| 350 | 352 | \\} |
| 351 | 353 | \\ |
| ... | ... | @@ -369,7 +371,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 369 | 371 | ); |
| 370 | 372 | // Inline function call |
| 371 | 373 | case.addCompareOutput( |
| 372 | \\export fn _start() noreturn { | |
| 374 | \\pub export fn _start() noreturn { | |
| 373 | 375 | \\ var x: usize = 5; |
| 374 | 376 | \\ const y = mul(2, 3, x); |
| 375 | 377 | \\ exit(y - 30); |