authorgravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-07-03 03:38:26+02:00
committergravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-07-03 22:14:13+02:00
logd4f6ff278391611890ed654adf37c6b8d5dd7708
tree62cc8a85f52d1667377da8b94913d38bde7e0003
parent25fcf03a678c4fc357d1342322cfe7ca058d9c0f

test-cases: run safety tests on wasm32-wasi


105 files changed, 105 insertions(+), 105 deletions(-)

test/cases/safety/@alignCast misaligned.zig +1-1
...@@ -22,4 +22,4 @@ fn foo(bytes: []u8) u32 {...@@ -22,4 +22,4 @@ fn foo(bytes: []u8) u32 {
22}22}
23// run23// run
24// backend=selfhosted,llvm24// backend=selfhosted,llvm
25// target=x86_64-linux,aarch64-linux25// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@enumFromInt - no matching tag value.zig +1-1
...@@ -23,4 +23,4 @@ fn baz(_: Foo) void {}...@@ -23,4 +23,4 @@ fn baz(_: Foo) void {}
2323
24// run24// run
25// backend=selfhosted,llvm25// backend=selfhosted,llvm
26// target=x86_64-linux26// target=x86_64-linux,wasm32-wasi
test/cases/safety/@enumFromInt truncated bits - exhaustive.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() u8 {...@@ -20,4 +20,4 @@ pub fn main() u8 {
2020
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux23// target=x86_64-linux,wasm32-wasi
test/cases/safety/@enumFromInt truncated bits - nonexhaustive.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() u8 {...@@ -20,4 +20,4 @@ pub fn main() u8 {
2020
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux23// target=x86_64-linux,wasm32-wasi
test/cases/safety/@errorCast error not present in destination.zig +1-1
...@@ -18,4 +18,4 @@ fn foo(set1: Set1) Set2 {...@@ -18,4 +18,4 @@ fn foo(set1: Set1) Set2 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/@errorCast error union casted to disjoint set.zig +1-1
...@@ -17,4 +17,4 @@ fn foo() anyerror!i32 {...@@ -17,4 +17,4 @@ fn foo() anyerror!i32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intCast negative to u0.zig +1-1
...@@ -19,4 +19,4 @@ fn bar(one: u1, not_zero: i32) void {...@@ -19,4 +19,4 @@ fn bar(one: u1, not_zero: i32) void {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux,aarch64-linux22// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@intCast positive to u0.zig +1-1
...@@ -19,4 +19,4 @@ fn bar(one: u1, not_zero: i32) void {...@@ -19,4 +19,4 @@ fn bar(one: u1, not_zero: i32) void {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux,aarch64-linux22// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - signed max.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - signed min.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 max.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux,aarch64-linux16// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - u0 min.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux,aarch64-linux16// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned max.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - unsigned min.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - vector max.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - boundary case - vector min.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux16// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - negative out of range.zig +1-1
...@@ -17,4 +17,4 @@ fn bar(a: f32) i8 {...@@ -17,4 +17,4 @@ fn bar(a: f32) i8 {
17fn baz(_: i8) void {}17fn baz(_: i8) void {}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - negative to unsigned.zig +1-1
...@@ -17,4 +17,4 @@ fn bar(a: f32) u8 {...@@ -17,4 +17,4 @@ fn bar(a: f32) u8 {
17fn baz(_: u8) void {}17fn baz(_: u8) void {}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/@intFromFloat cannot fit - positive out of range.zig +1-1
...@@ -17,4 +17,4 @@ fn bar(a: f32) u8 {...@@ -17,4 +17,4 @@ fn bar(a: f32) u8 {
17fn baz(_: u8) void {}17fn baz(_: u8) void {}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/@ptrFromInt address zero to non-optional byte-aligned pointer.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@ptrFromInt address zero to non-optional pointer.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@ptrFromInt with misaligned address.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/@tagName on corrupted enum value.zig +1-1
...@@ -23,4 +23,4 @@ pub fn main() !void {...@@ -23,4 +23,4 @@ pub fn main() !void {
2323
24// run24// run
25// backend=selfhosted,llvm25// backend=selfhosted,llvm
26// target=x86_64-linux26// target=x86_64-linux,wasm32-wasi
test/cases/safety/@tagName on corrupted union value.zig +1-1
...@@ -24,4 +24,4 @@ pub fn main() !void {...@@ -24,4 +24,4 @@ pub fn main() !void {
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux27// target=x86_64-linux,wasm32-wasi
test/cases/safety/array slice sentinel mismatch vector.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux19// target=x86_64-linux,wasm32-wasi
test/cases/safety/array slice sentinel mismatch.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/bad union field access.zig +1-1
...@@ -24,4 +24,4 @@ fn bar(f: *Foo) void {...@@ -24,4 +24,4 @@ fn bar(f: *Foo) void {
24}24}
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux27// target=x86_64-linux,wasm32-wasi
test/cases/safety/calling panic.zig +1-1
...@@ -13,4 +13,4 @@ pub fn main() !void {...@@ -13,4 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=selfhosted,llvm15// backend=selfhosted,llvm
16// target=x86_64-linux,aarch64-linux16// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/cast []u8 to bigger slice of wrong size.zig +1-1
...@@ -18,4 +18,4 @@ fn widenSlice(slice: []align(1) const u8) []align(1) const i32 {...@@ -18,4 +18,4 @@ fn widenSlice(slice: []align(1) const u8) []align(1) const i32 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/cast integer to global error and no code matches.zig +1-1
...@@ -16,4 +16,4 @@ fn bar(x: u16) anyerror {...@@ -16,4 +16,4 @@ fn bar(x: u16) anyerror {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/deref_null_c_pointer.zig+1-1
...@@ -14,4 +14,4 @@ pub fn main() !void {...@@ -14,4 +14,4 @@ pub fn main() !void {
1414
15// run15// run
16// backend=selfhosted,llvm16// backend=selfhosted,llvm
17// target=x86_64-linux,aarch64-linux17// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/empty slice with sentinel out of bounds.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/exact division failure - vectors.zig +1-1
...@@ -20,4 +20,4 @@ fn divExact(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -20,4 +20,4 @@ fn divExact(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
20}20}
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux23// target=x86_64-linux,wasm32-wasi
test/cases/safety/exact division failure.zig +1-1
...@@ -18,4 +18,4 @@ fn divExact(a: i32, b: i32) i32 {...@@ -18,4 +18,4 @@ fn divExact(a: i32, b: i32) i32 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/for_len_mismatch.zig+1-1
...@@ -22,4 +22,4 @@ pub fn main() !void {...@@ -22,4 +22,4 @@ pub fn main() !void {
22}22}
23// run23// run
24// backend=selfhosted,llvm24// backend=selfhosted,llvm
25// target=x86_64-linux,aarch64-linux25// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/for_len_mismatch_three.zig+1-1
...@@ -21,4 +21,4 @@ pub fn main() !void {...@@ -21,4 +21,4 @@ pub fn main() !void {
21}21}
22// run22// run
23// backend=selfhosted,llvm23// backend=selfhosted,llvm
24// target=x86_64-linux,aarch64-linux24// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/ignored expression integer overflow.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/integer addition overflow.zig +1-1
...@@ -20,4 +20,4 @@ fn add(a: u16, b: u16) u16 {...@@ -20,4 +20,4 @@ fn add(a: u16, b: u16) u16 {
2020
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux,aarch64-linux23// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/integer division by zero - vectors.zig +1-1
...@@ -19,4 +19,4 @@ fn div0(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -19,4 +19,4 @@ fn div0(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux22// target=x86_64-linux,wasm32-wasi
test/cases/safety/integer division by zero.zig +1-1
...@@ -17,4 +17,4 @@ fn div0(a: i32, b: i32) i32 {...@@ -17,4 +17,4 @@ fn div0(a: i32, b: i32) i32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/integer multiplication overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn mul(a: u16, b: u16) u16 {...@@ -18,4 +18,4 @@ fn mul(a: u16, b: u16) u16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/integer negation overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn neg(a: i16) i16 {...@@ -18,4 +18,4 @@ fn neg(a: i16) i16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/integer subtraction overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn sub(a: u16, b: u16) u16 {...@@ -18,4 +18,4 @@ fn sub(a: u16, b: u16) u16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memcpy_alias.zig+1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memcpy_len_mismatch.zig+1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memmove_len_mismatch.zig+1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memset_array_undefined_bytes.zig+1-1
...@@ -15,4 +15,4 @@ pub fn main() !void {...@@ -15,4 +15,4 @@ pub fn main() !void {
15}15}
16// run16// run
17// backend=selfhosted,llvm17// backend=selfhosted,llvm
18// target=x86_64-linux,aarch64-linux18// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memset_array_undefined_large.zig+1-1
...@@ -15,4 +15,4 @@ pub fn main() !void {...@@ -15,4 +15,4 @@ pub fn main() !void {
15}15}
16// run16// run
17// backend=selfhosted,llvm17// backend=selfhosted,llvm
18// target=x86_64-linux,aarch64-linux18// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memset_slice_undefined_bytes.zig+1-1
...@@ -17,4 +17,4 @@ pub fn main() !void {...@@ -17,4 +17,4 @@ pub fn main() !void {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/memset_slice_undefined_large.zig+1-1
...@@ -17,4 +17,4 @@ pub fn main() !void {...@@ -17,4 +17,4 @@ pub fn main() !void {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/modrem by zero.zig +1-1
...@@ -17,4 +17,4 @@ fn div0(a: u32, b: u32) u32 {...@@ -17,4 +17,4 @@ fn div0(a: u32, b: u32) u32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/modulus by zero.zig +1-1
...@@ -17,4 +17,4 @@ fn mod0(a: i32, b: i32) i32 {...@@ -17,4 +17,4 @@ fn mod0(a: i32, b: i32) i32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/noreturn returned.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() void {...@@ -20,4 +20,4 @@ pub fn main() void {
20}20}
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux,aarch64-linux23// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/optional unwrap operator on C pointer.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/optional unwrap operator on null pointer.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/optional_empty_error_set.zig+1-1
...@@ -19,4 +19,4 @@ fn foo() !void {...@@ -19,4 +19,4 @@ fn foo() !void {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux,aarch64-linux22// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/out of bounds array slice by length.zig +1-1
...@@ -17,4 +17,4 @@ fn foo(a: u32) u32 {...@@ -17,4 +17,4 @@ fn foo(a: u32) u32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/out of bounds slice access.zig +1-1
...@@ -18,4 +18,4 @@ fn bar(a: []const i32) i32 {...@@ -18,4 +18,4 @@ fn bar(a: []const i32) i32 {
18fn baz(_: i32) void {}18fn baz(_: i32) void {}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/pointer casting null to non-optional pointer.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/pointer casting to null function pointer.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() !void {...@@ -20,4 +20,4 @@ pub fn main() !void {
2020
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux,aarch64-linux23// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/pointer slice sentinel mismatch.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/ref_deref_null_c_pointer.zig+1-1
...@@ -14,4 +14,4 @@ pub fn main() !void {...@@ -14,4 +14,4 @@ pub fn main() !void {
1414
15// run15// run
16// backend=selfhosted,llvm16// backend=selfhosted,llvm
17// target=x86_64-linux,aarch64-linux17// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/remainder division by zero.zig +1-1
...@@ -17,4 +17,4 @@ fn rem0(a: i32, b: i32) i32 {...@@ -17,4 +17,4 @@ fn rem0(a: i32, b: i32) i32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/shift left by huge amount.zig +1-1
...@@ -19,4 +19,4 @@ pub fn main() !void {...@@ -19,4 +19,4 @@ pub fn main() !void {
1919
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux,aarch64-linux22// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/shift right by huge amount.zig +1-1
...@@ -19,4 +19,4 @@ pub fn main() !void {...@@ -19,4 +19,4 @@ pub fn main() !void {
1919
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux,aarch64-linux22// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/signed integer division overflow - vectors.zig +1-1
...@@ -20,4 +20,4 @@ fn div(a: @Vector(4, i16), b: @Vector(4, i16)) @Vector(4, i16) {...@@ -20,4 +20,4 @@ fn div(a: @Vector(4, i16), b: @Vector(4, i16)) @Vector(4, i16) {
20}20}
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux23// target=x86_64-linux,wasm32-wasi
test/cases/safety/signed integer division overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn div(a: i16, b: i16) i16 {...@@ -18,4 +18,4 @@ fn div(a: i16, b: i16) i16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/signed integer not fitting in cast to unsigned integer - widening.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux19// target=x86_64-linux,wasm32-wasi
test/cases/safety/signed integer not fitting in cast to unsigned integer.zig +1-1
...@@ -17,4 +17,4 @@ fn unsigned_cast(x: i32) u32 {...@@ -17,4 +17,4 @@ fn unsigned_cast(x: i32) u32 {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/signed shift left overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn shl(a: i16, b: u4) i16 {...@@ -18,4 +18,4 @@ fn shl(a: i16, b: u4) i16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/signed shift right overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn shr(a: i16, b: u4) i16 {...@@ -18,4 +18,4 @@ fn shr(a: i16, b: u4) i16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/signed-unsigned vector cast.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/slice by length sentinel mismatch on lhs.zig +1-1
...@@ -15,4 +15,4 @@ pub fn main() !void {...@@ -15,4 +15,4 @@ pub fn main() !void {
15}15}
16// run16// run
17// backend=selfhosted,llvm17// backend=selfhosted,llvm
18// target=x86_64-linux,aarch64-linux18// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice by length sentinel mismatch on rhs.zig +1-1
...@@ -15,4 +15,4 @@ pub fn main() !void {...@@ -15,4 +15,4 @@ pub fn main() !void {
15}15}
16// run16// run
17// backend=selfhosted,llvm17// backend=selfhosted,llvm
18// target=x86_64-linux,aarch64-linux18// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice sentinel mismatch - floats.zig +1-1
...@@ -17,4 +17,4 @@ pub fn main() !void {...@@ -17,4 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux20// target=x86_64-linux,wasm32-wasi
test/cases/safety/slice sentinel mismatch - optional pointers.zig +1-1
...@@ -17,4 +17,4 @@ pub fn main() !void {...@@ -17,4 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice slice sentinel mismatch.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice start index greater than end index.zig +1-1
...@@ -21,4 +21,4 @@ pub fn main() !void {...@@ -21,4 +21,4 @@ pub fn main() !void {
2121
22// run22// run
23// backend=selfhosted,llvm23// backend=selfhosted,llvm
24// target=x86_64-linux,aarch64-linux24// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice with sentinel out of bounds - runtime len.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() !void {...@@ -20,4 +20,4 @@ pub fn main() !void {
2020
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux,aarch64-linux23// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice with sentinel out of bounds.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice_cast_change_len_0.zig+1-1
...@@ -24,4 +24,4 @@ const std = @import("std");...@@ -24,4 +24,4 @@ const std = @import("std");
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux,aarch64-linux27// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice_cast_change_len_1.zig+1-1
...@@ -24,4 +24,4 @@ const std = @import("std");...@@ -24,4 +24,4 @@ const std = @import("std");
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux,aarch64-linux27// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slice_cast_change_len_2.zig+1-1
...@@ -24,4 +24,4 @@ const std = @import("std");...@@ -24,4 +24,4 @@ const std = @import("std");
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux,aarch64-linux27// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slicing null C pointer - runtime len.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/slicing null C pointer.zig +1-1
...@@ -17,4 +17,4 @@ pub fn main() !void {...@@ -17,4 +17,4 @@ pub fn main() !void {
17}17}
18// run18// run
19// backend=selfhosted,llvm19// backend=selfhosted,llvm
20// target=x86_64-linux,aarch64-linux20// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/switch else on corrupt enum value - one prong.zig +1-1
...@@ -21,4 +21,4 @@ pub fn main() !void {...@@ -21,4 +21,4 @@ pub fn main() !void {
21}21}
22// run22// run
23// backend=selfhosted,llvm23// backend=selfhosted,llvm
24// target=x86_64-linux24// target=x86_64-linux,wasm32-wasi
test/cases/safety/switch else on corrupt enum value - union.zig +1-1
...@@ -26,4 +26,4 @@ pub fn main() !void {...@@ -26,4 +26,4 @@ pub fn main() !void {
26}26}
27// run27// run
28// backend=selfhosted,llvm28// backend=selfhosted,llvm
29// target=x86_64-linux29// target=x86_64-linux,wasm32-wasi
test/cases/safety/switch else on corrupt enum value.zig +1-1
...@@ -20,4 +20,4 @@ pub fn main() !void {...@@ -20,4 +20,4 @@ pub fn main() !void {
20}20}
21// run21// run
22// backend=selfhosted,llvm22// backend=selfhosted,llvm
23// target=x86_64-linux23// target=x86_64-linux,wasm32-wasi
test/cases/safety/switch on corrupted enum value.zig +1-1
...@@ -24,4 +24,4 @@ pub fn main() !void {...@@ -24,4 +24,4 @@ pub fn main() !void {
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux,aarch64-linux27// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/switch on corrupted union value.zig +1-1
...@@ -24,4 +24,4 @@ pub fn main() !void {...@@ -24,4 +24,4 @@ pub fn main() !void {
2424
25// run25// run
26// backend=selfhosted,llvm26// backend=selfhosted,llvm
27// target=x86_64-linux27// target=x86_64-linux,wasm32-wasi
test/cases/safety/truncating vector cast.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/unreachable.zig+1-1
...@@ -12,4 +12,4 @@ pub fn main() !void {...@@ -12,4 +12,4 @@ pub fn main() !void {
12}12}
13// run13// run
14// backend=selfhosted,llvm14// backend=selfhosted,llvm
15// target=x86_64-linux,aarch64-linux15// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/unsigned integer not fitting in cast to signed integer - same bit count.zig +1-1
...@@ -16,4 +16,4 @@ pub fn main() !void {...@@ -16,4 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux19// target=x86_64-linux,wasm32-wasi
test/cases/safety/unsigned shift left overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn shl(a: u16, b: u4) u16 {...@@ -18,4 +18,4 @@ fn shl(a: u16, b: u4) u16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/unsigned shift right overflow.zig +1-1
...@@ -18,4 +18,4 @@ fn shr(a: u16, b: u4) u16 {...@@ -18,4 +18,4 @@ fn shr(a: u16, b: u4) u16 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/unsigned-signed vector cast.zig +1-1
...@@ -18,4 +18,4 @@ pub fn main() !void {...@@ -18,4 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux21// target=x86_64-linux,wasm32-wasi
test/cases/safety/unwrap error switch.zig +1-1
...@@ -18,4 +18,4 @@ fn bar() !void {...@@ -18,4 +18,4 @@ fn bar() !void {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/unwrap error.zig +1-1
...@@ -16,4 +16,4 @@ fn bar() !void {...@@ -16,4 +16,4 @@ fn bar() !void {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/value does not fit in shortening cast - u0.zig +1-1
...@@ -18,4 +18,4 @@ fn shorten_cast(x: u8) u0 {...@@ -18,4 +18,4 @@ fn shorten_cast(x: u8) u0 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/value does not fit in shortening cast.zig +1-1
...@@ -18,4 +18,4 @@ fn shorten_cast(x: i32) i8 {...@@ -18,4 +18,4 @@ fn shorten_cast(x: i32) i8 {
18}18}
19// run19// run
20// backend=selfhosted,llvm20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux21// target=x86_64-linux,aarch64-linux,wasm32-wasi
test/cases/safety/vector integer addition overflow.zig +1-1
...@@ -19,4 +19,4 @@ fn add(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -19,4 +19,4 @@ fn add(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux22// target=x86_64-linux,wasm32-wasi
test/cases/safety/vector integer multiplication overflow.zig +1-1
...@@ -19,4 +19,4 @@ fn mul(a: @Vector(4, u8), b: @Vector(4, u8)) @Vector(4, u8) {...@@ -19,4 +19,4 @@ fn mul(a: @Vector(4, u8), b: @Vector(4, u8)) @Vector(4, u8) {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux22// target=x86_64-linux,wasm32-wasi
test/cases/safety/vector integer negation overflow.zig +1-1
...@@ -19,4 +19,4 @@ fn neg(a: @Vector(4, i16)) @Vector(4, i16) {...@@ -19,4 +19,4 @@ fn neg(a: @Vector(4, i16)) @Vector(4, i16) {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux22// target=x86_64-linux,wasm32-wasi
test/cases/safety/vector integer subtraction overflow.zig +1-1
...@@ -19,4 +19,4 @@ fn sub(a: @Vector(4, u32), b: @Vector(4, u32)) @Vector(4, u32) {...@@ -19,4 +19,4 @@ fn sub(a: @Vector(4, u32), b: @Vector(4, u32)) @Vector(4, u32) {
19}19}
20// run20// run
21// backend=selfhosted,llvm21// backend=selfhosted,llvm
22// target=x86_64-linux22// target=x86_64-linux,wasm32-wasi
test/cases/safety/zero casted to error.zig +1-1
...@@ -16,4 +16,4 @@ fn bar(x: u16) anyerror {...@@ -16,4 +16,4 @@ fn bar(x: u16) anyerror {
16}16}
17// run17// run
18// backend=selfhosted,llvm18// backend=selfhosted,llvm
19// target=x86_64-linux,aarch64-linux19// target=x86_64-linux,aarch64-linux,wasm32-wasi