aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-08-07 23:10:57 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-08-19 16:45:15 -0700
commit507aae4a1a3db498ece2a3a89d74e9e24d952923 (patch)
treedb52f3b00d0def30488e7ce81adc8685c4945874 /test
parent73bbd1069a993a0e663033ea3b8cd4ed1a123566 (diff)
downloadzig-507aae4a1a3db498ece2a3a89d74e9e24d952923.tar.gz
zig-507aae4a1a3db498ece2a3a89d74e9e24d952923.zip
make self-hosted the default compiler
stage1 is available behind the -fstage1 flag. closes #89
Diffstat (limited to 'test')
-rw-r--r--test/cases/safety/empty slice with sentinel out of bounds.zig2
-rw-r--r--test/cases/safety/out of bounds slice access.zig6
-rw-r--r--test/cases/safety/slice with sentinel out of bounds - runtime len.zig2
-rw-r--r--test/cases/safety/slice with sentinel out of bounds.zig2
-rw-r--r--test/tests.zig3
5 files changed, 7 insertions, 8 deletions
diff --git a/test/cases/safety/empty slice with sentinel out of bounds.zig b/test/cases/safety/empty slice with sentinel out of bounds.zig
index 835b084740..d989a33541 100644
--- a/test/cases/safety/empty slice with sentinel out of bounds.zig
+++ b/test/cases/safety/empty slice with sentinel out of bounds.zig
@@ -2,7 +2,7 @@ const std = @import("std");
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
_ = stack_trace;
- if (std.mem.eql(u8, message, "attempt to index out of bound: index 1, len 0")) {
+ if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) {
std.process.exit(0);
}
std.process.exit(1);
diff --git a/test/cases/safety/out of bounds slice access.zig b/test/cases/safety/out of bounds slice access.zig
index a30532aee7..ddd9e74cf2 100644
--- a/test/cases/safety/out of bounds slice access.zig
+++ b/test/cases/safety/out of bounds slice access.zig
@@ -2,20 +2,20 @@ const std = @import("std");
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
_ = stack_trace;
- if (std.mem.eql(u8, message, "attempt to index out of bound: index 4, len 4")) {
+ if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) {
std.process.exit(0);
}
std.process.exit(1);
}
pub fn main() !void {
- const a = [_]i32{1, 2, 3, 4};
+ const a = [_]i32{ 1, 2, 3, 4 };
baz(bar(&a));
return error.TestFailed;
}
fn bar(a: []const i32) i32 {
return a[4];
}
-fn baz(_: i32) void { }
+fn baz(_: i32) void {}
// run
// backend=llvm
// target=native
diff --git a/test/cases/safety/slice with sentinel out of bounds - runtime len.zig b/test/cases/safety/slice with sentinel out of bounds - runtime len.zig
index fa2e127107..524c69d7b7 100644
--- a/test/cases/safety/slice with sentinel out of bounds - runtime len.zig
+++ b/test/cases/safety/slice with sentinel out of bounds - runtime len.zig
@@ -2,7 +2,7 @@ const std = @import("std");
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
_ = stack_trace;
- if (std.mem.eql(u8, message, "attempt to index out of bound: index 5, len 4")) {
+ if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
std.process.exit(0);
}
std.process.exit(1);
diff --git a/test/cases/safety/slice with sentinel out of bounds.zig b/test/cases/safety/slice with sentinel out of bounds.zig
index 3cc8bfb355..636235a5b3 100644
--- a/test/cases/safety/slice with sentinel out of bounds.zig
+++ b/test/cases/safety/slice with sentinel out of bounds.zig
@@ -2,7 +2,7 @@ const std = @import("std");
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
_ = stack_trace;
- if (std.mem.eql(u8, message, "attempt to index out of bound: index 5, len 4")) {
+ if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
std.process.exit(0);
}
std.process.exit(1);
diff --git a/test/tests.zig b/test/tests.zig
index e1836dc1e0..bd3c1c5dec 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -601,7 +601,6 @@ pub fn addPkgTests(
skip_libc: bool,
skip_stage1: bool,
skip_stage2: bool,
- is_stage1: bool,
) *build.Step {
const step = b.step(b.fmt("test-{s}", .{name}), desc);
@@ -630,7 +629,7 @@ pub fn addPkgTests(
if (test_target.backend) |backend| switch (backend) {
.stage1 => if (skip_stage1) continue,
else => if (skip_stage2) continue,
- } else if (is_stage1 and skip_stage1) continue;
+ } else if (skip_stage2) continue;
const want_this_mode = for (modes) |m| {
if (m == test_target.mode) break true;