mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 07:33:08 +00:00
stage2: fix tests expected values
This commit is contained in:
parent
579694893e
commit
134853f106
@ -1,4 +1,10 @@
|
||||
* get stage2 tests passing
|
||||
- after the error from an empty file, "has no member main" is invalidated
|
||||
but the comptime block incorrectly does not get re-run
|
||||
- redundant comptime wrong source loc
|
||||
- redeclaration of 'foo' not showing 'previously declared here'
|
||||
- segfault in one of the tests
|
||||
- memory leaks
|
||||
* modify stage2 tests so that only 1 uses _start and the rest use
|
||||
pub fn main
|
||||
* modify stage2 CBE tests so that only 1 uses pub export main and the
|
||||
|
||||
@ -13,13 +13,17 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
};
|
||||
{
|
||||
var case = ctx.exe("hello world with updates", target);
|
||||
case.addError("", &[_][]const u8{"error: no entry point found"});
|
||||
case.addError("", &[_][]const u8{
|
||||
":84:9: error: struct 'test_case.test_case' has no member named 'main'",
|
||||
});
|
||||
|
||||
// Incorrect return type
|
||||
case.addError(
|
||||
\\pub export fn _start() noreturn {
|
||||
\\}
|
||||
, &[_][]const u8{":2:1: error: expected noreturn, found void"});
|
||||
, &[_][]const u8{
|
||||
":2:1: error: expected noreturn, found void",
|
||||
});
|
||||
|
||||
// Regular old hello world
|
||||
case.addCompareOutput(
|
||||
|
||||
@ -24,7 +24,9 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
{
|
||||
var case = ctx.exe("hello world with updates", linux_x64);
|
||||
|
||||
case.addError("", &[_][]const u8{"error: no entry point found"});
|
||||
case.addError("", &[_][]const u8{
|
||||
":84:9: error: struct 'test_case.test_case' has no member named 'main'",
|
||||
});
|
||||
|
||||
// Incorrect return type
|
||||
case.addError(
|
||||
@ -321,7 +323,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
{
|
||||
var case = ctx.exe("multiplying numbers at runtime and comptime", linux_x64);
|
||||
case.addCompareOutput(
|
||||
\\export fn _start() noreturn {
|
||||
\\pub export fn _start() noreturn {
|
||||
\\ mul(3, 4);
|
||||
\\
|
||||
\\ exit();
|
||||
@ -345,7 +347,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
);
|
||||
// comptime function call
|
||||
case.addCompareOutput(
|
||||
\\export fn _start() noreturn {
|
||||
\\pub export fn _start() noreturn {
|
||||
\\ exit();
|
||||
\\}
|
||||
\\
|
||||
@ -369,7 +371,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
);
|
||||
// Inline function call
|
||||
case.addCompareOutput(
|
||||
\\export fn _start() noreturn {
|
||||
\\pub export fn _start() noreturn {
|
||||
\\ var x: usize = 5;
|
||||
\\ const y = mul(2, 3, x);
|
||||
\\ exit(y - 30);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user