authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-13 17:58:32-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-05-13 17:59:06-07:00
log0cd43b0f8686075cf9bb8b8655ca828bd329d60f
tree442689a62f99e8f0dc64e67e090e95d0aa2a0fda
parent7d8b90b9050a3e957e4ab936b149f3b45b6b6000

runtime safety tests only on the native target

This matches master branch. We can look into adding more target coverage as we switch to stage2. As it stands, this works around having to duplicate the "Executor" logic to figure out when to not run the tests due to them being non-native.

68 files changed, 104 insertions(+), 37 deletions(-)

test/cases/safety/@alignCast misaligned.zig +2-1
...@@ -18,4 +18,5 @@ fn foo(bytes: []u8) u32 {...@@ -18,4 +18,5 @@ fn foo(bytes: []u8) u32 {
18 return int_slice[0];18 return int_slice[0];
19}19}
20// run20// run
21// backend=stage1
\ No newline at end of file
21// backend=stage1
22// target=native
\ No newline at end of file
test/cases/safety/@asyncCall with too small a frame.zig +1
...@@ -22,3 +22,4 @@ fn other() callconv(.Async) void {...@@ -22,3 +22,4 @@ fn other() callconv(.Async) void {
22}22}
23// run23// run
24// backend=stage124// backend=stage1
25// target=native
test/cases/safety/@errSetCast error not present in destination.zig +2-1
...@@ -15,4 +15,5 @@ fn foo(set1: Set1) Set2 {...@@ -15,4 +15,5 @@ fn foo(set1: Set1) Set2 {
15 return @errSetCast(Set2, set1);15 return @errSetCast(Set2, set1);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/@floatToInt cannot fit - negative out of range.zig +2-1
...@@ -14,4 +14,5 @@ fn bar(a: f32) i8 {...@@ -14,4 +14,5 @@ fn bar(a: f32) i8 {
14}14}
15fn baz(_: i8) void { }15fn baz(_: i8) void { }
16// run16// run
17// backend=stage1
\ No newline at end of file
17// backend=stage1
18// target=native
\ No newline at end of file
test/cases/safety/@floatToInt cannot fit - negative to unsigned.zig +2-1
...@@ -14,4 +14,5 @@ fn bar(a: f32) u8 {...@@ -14,4 +14,5 @@ fn bar(a: f32) u8 {
14}14}
15fn baz(_: u8) void { }15fn baz(_: u8) void { }
16// run16// run
17// backend=stage1
\ No newline at end of file
17// backend=stage1
18// target=native
\ No newline at end of file
test/cases/safety/@floatToInt cannot fit - positive out of range.zig +2-1
...@@ -14,4 +14,5 @@ fn bar(a: f32) u8 {...@@ -14,4 +14,5 @@ fn bar(a: f32) u8 {
14}14}
15fn baz(_: u8) void { }15fn baz(_: u8) void { }
16// run16// run
17// backend=stage1
\ No newline at end of file
17// backend=stage1
18// target=native
\ No newline at end of file
test/cases/safety/@intCast to u0.zig +2-1
...@@ -16,4 +16,5 @@ fn bar(one: u1, not_zero: i32) void {...@@ -16,4 +16,5 @@ fn bar(one: u1, not_zero: i32) void {
16 _ = x;16 _ = x;
17}17}
18// run18// run
19// backend=stage1
\ No newline at end of file
19// backend=stage1
20// target=native
\ No newline at end of file
test/cases/safety/@intToEnum - no matching tag value.zig +1
...@@ -20,3 +20,4 @@ fn bar(a: u2) Foo {...@@ -20,3 +20,4 @@ fn bar(a: u2) Foo {
20fn baz(_: Foo) void {}20fn baz(_: Foo) void {}
21// run21// run
22// backend=stage122// backend=stage1
23// target=native
test/cases/safety/@intToPtr address zero to non-optional byte-aligned pointer.zig +1
...@@ -13,3 +13,4 @@ pub fn main() !void {...@@ -13,3 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=stage115// backend=stage1
16// target=native
test/cases/safety/@intToPtr address zero to non-optional pointer.zig +1
...@@ -13,3 +13,4 @@ pub fn main() !void {...@@ -13,3 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=stage115// backend=stage1
16// target=native
test/cases/safety/@tagName on corrupted enum value.zig +1
...@@ -22,3 +22,4 @@ pub fn main() !void {...@@ -22,3 +22,4 @@ pub fn main() !void {
2222
23// run23// run
24// backend=stage124// backend=stage1
25// target=native
test/cases/safety/@tagName on corrupted union value.zig +1
...@@ -23,3 +23,4 @@ pub fn main() !void {...@@ -23,3 +23,4 @@ pub fn main() !void {
2323
24// run24// run
25// backend=stage125// backend=stage1
26// target=native
test/cases/safety/array slice sentinel mismatch.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=stage117// backend=stage1
1818// target=native
test/cases/safety/awaiting twice.zig +1
...@@ -26,3 +26,4 @@ fn func() void {...@@ -26,3 +26,4 @@ fn func() void {
26}26}
27// run27// run
28// backend=stage128// backend=stage1
29// target=native
test/cases/safety/bad union field access.zig +2-1
...@@ -21,4 +21,5 @@ fn bar(f: *Foo) void {...@@ -21,4 +21,5 @@ fn bar(f: *Foo) void {
21 f.float = 12.34;21 f.float = 12.34;
22}22}
23// run23// run
24// backend=stage1
\ No newline at end of file
24// backend=stage1
25// target=native
\ No newline at end of file
test/cases/safety/calling panic.zig +2-1
...@@ -12,4 +12,5 @@ pub fn main() !void {...@@ -12,4 +12,5 @@ pub fn main() !void {
12 return error.TestFailed;12 return error.TestFailed;
13}13}
14// run14// run
15// backend=stage1
\ No newline at end of file
15// backend=stage1
16// target=native
\ No newline at end of file
test/cases/safety/cast []u8 to bigger slice of wrong size.zig +2-1
...@@ -15,4 +15,5 @@ fn widenSlice(slice: []align(1) const u8) []align(1) const i32 {...@@ -15,4 +15,5 @@ fn widenSlice(slice: []align(1) const u8) []align(1) const i32 {
15 return std.mem.bytesAsSlice(i32, slice);15 return std.mem.bytesAsSlice(i32, slice);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/cast integer to global error and no code matches.zig +2-1
...@@ -13,4 +13,5 @@ fn bar(x: u16) anyerror {...@@ -13,4 +13,5 @@ fn bar(x: u16) anyerror {
13 return @intToError(x);13 return @intToError(x);
14}14}
15// run15// run
16// backend=stage1
\ No newline at end of file
16// backend=stage1
17// target=native
\ No newline at end of file
test/cases/safety/empty slice with sentinel out of bounds.zig +1
...@@ -18,3 +18,4 @@ pub fn main() !void {...@@ -18,3 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/error return trace across suspend points.zig +2-1
...@@ -35,4 +35,5 @@ fn printTrace(p: anyframe->anyerror!void) void {...@@ -35,4 +35,5 @@ fn printTrace(p: anyframe->anyerror!void) void {
35 (await p) catch unreachable;35 (await p) catch unreachable;
36}36}
37// run37// run
38// backend=stage1
\ No newline at end of file
38// backend=stage1
39// target=native
\ No newline at end of file
test/cases/safety/exact division failure - vectors.zig +2-1
...@@ -17,4 +17,5 @@ fn divExact(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -17,4 +17,5 @@ fn divExact(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
17 return @divExact(a, b);17 return @divExact(a, b);
18}18}
19// run19// run
20// backend=stage1
\ No newline at end of file
20// backend=stage1
21// target=native
\ No newline at end of file
test/cases/safety/exact division failure.zig +2-1
...@@ -15,4 +15,5 @@ fn divExact(a: i32, b: i32) i32 {...@@ -15,4 +15,5 @@ fn divExact(a: i32, b: i32) i32 {
15 return @divExact(a, b);15 return @divExact(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/intToPtr with misaligned address.zig +1
...@@ -15,3 +15,4 @@ pub fn main() !void {...@@ -15,3 +15,4 @@ pub fn main() !void {
15}15}
16// run16// run
17// backend=stage117// backend=stage1
18// target=native
test/cases/safety/integer addition overflow.zig +1
...@@ -20,3 +20,4 @@ fn add(a: u16, b: u16) u16 {...@@ -20,3 +20,4 @@ fn add(a: u16, b: u16) u16 {
2020
21// run21// run
22// backend=stage122// backend=stage1
23// target=native
test/cases/safety/integer division by zero - vectors.zig +2-1
...@@ -16,4 +16,5 @@ fn div0(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -16,4 +16,5 @@ fn div0(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
16 return @divTrunc(a, b);16 return @divTrunc(a, b);
17}17}
18// run18// run
19// backend=stage1
\ No newline at end of file
19// backend=stage1
20// target=native
\ No newline at end of file
test/cases/safety/integer division by zero.zig +2-1
...@@ -14,4 +14,5 @@ fn div0(a: i32, b: i32) i32 {...@@ -14,4 +14,5 @@ fn div0(a: i32, b: i32) i32 {
14 return @divTrunc(a, b);14 return @divTrunc(a, b);
15}15}
16// run16// run
17// backend=stage1
\ No newline at end of file
17// backend=stage1
18// target=native
\ No newline at end of file
test/cases/safety/integer multiplication overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn mul(a: u16, b: u16) u16 {...@@ -15,4 +15,5 @@ fn mul(a: u16, b: u16) u16 {
15 return a * b;15 return a * b;
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/integer negation overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn neg(a: i16) i16 {...@@ -15,4 +15,5 @@ fn neg(a: i16) i16 {
15 return -a;15 return -a;
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/integer subtraction overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn sub(a: u16, b: u16) u16 {...@@ -15,4 +15,5 @@ fn sub(a: u16, b: u16) u16 {
15 return a - b;15 return a - b;
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/invalid resume of async function.zig +1
...@@ -16,3 +16,4 @@ fn suspendOnce() void {...@@ -16,3 +16,4 @@ fn suspendOnce() void {
16}16}
17// run17// run
18// backend=stage118// backend=stage1
19// target=native
test/cases/safety/nosuspend function call, callee suspends.zig +1
...@@ -17,3 +17,4 @@ fn add(a: i32, b: i32) i32 {...@@ -17,3 +17,4 @@ fn add(a: i32, b: i32) i32 {
17}17}
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/optional unwrap operator on C pointer.zig +1
...@@ -13,3 +13,4 @@ pub fn main() !void {...@@ -13,3 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=stage115// backend=stage1
16// target=native
test/cases/safety/optional unwrap operator on null pointer.zig +1
...@@ -13,3 +13,4 @@ pub fn main() !void {...@@ -13,3 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=stage115// backend=stage1
16// target=native
test/cases/safety/out of bounds slice access.zig +2-1
...@@ -15,4 +15,5 @@ fn bar(a: []const i32) i32 {...@@ -15,4 +15,5 @@ fn bar(a: []const i32) i32 {
15}15}
16fn baz(_: i32) void { }16fn baz(_: i32) void { }
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/pointer casting null to non-optional pointer.zig +1
...@@ -13,3 +13,4 @@ pub fn main() !void {...@@ -13,3 +13,4 @@ pub fn main() !void {
13}13}
14// run14// run
15// backend=stage115// backend=stage1
16// target=native
test/cases/safety/pointer slice sentinel mismatch.zig +1
...@@ -18,3 +18,4 @@ pub fn main() !void {...@@ -18,3 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/resuming a function which is awaiting a call.zig +1
...@@ -18,3 +18,4 @@ fn other() void {...@@ -18,3 +18,4 @@ fn other() void {
18}18}
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/resuming a function which is awaiting a frame.zig +1
...@@ -19,3 +19,4 @@ fn other() void {...@@ -19,3 +19,4 @@ fn other() void {
19}19}
20// run20// run
21// backend=stage121// backend=stage1
22// target=native
test/cases/safety/resuming a non-suspended function which has been suspended and resumed.zig +1
...@@ -29,3 +29,4 @@ pub fn main() !void {...@@ -29,3 +29,4 @@ pub fn main() !void {
29}29}
30// run30// run
31// backend=stage131// backend=stage1
32// target=native
test/cases/safety/resuming a non-suspended function which never been suspended.zig +1
...@@ -24,3 +24,4 @@ pub fn main() !void {...@@ -24,3 +24,4 @@ pub fn main() !void {
24}24}
25// run25// run
26// backend=stage126// backend=stage1
27// target=native
test/cases/safety/shift left by huge amount.zig +1
...@@ -18,3 +18,4 @@ pub fn main() !void {...@@ -18,3 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/shift right by huge amount.zig +1
...@@ -18,3 +18,4 @@ pub fn main() !void {...@@ -18,3 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/signed integer division overflow - vectors.zig +2-1
...@@ -17,4 +17,5 @@ fn div(a: @Vector(4, i16), b: @Vector(4, i16)) @Vector(4, i16) {...@@ -17,4 +17,5 @@ fn div(a: @Vector(4, i16), b: @Vector(4, i16)) @Vector(4, i16) {
17 return @divTrunc(a, b);17 return @divTrunc(a, b);
18}18}
19// run19// run
20// backend=stage1
\ No newline at end of file
20// backend=stage1
21// target=native
\ No newline at end of file
test/cases/safety/signed integer division overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn div(a: i16, b: i16) i16 {...@@ -15,4 +15,5 @@ fn div(a: i16, b: i16) i16 {
15 return @divTrunc(a, b);15 return @divTrunc(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/signed integer not fitting in cast to unsigned integer - widening.zig +2-1
...@@ -12,4 +12,5 @@ pub fn main() !void {...@@ -12,4 +12,5 @@ pub fn main() !void {
12 return error.TestFailed;12 return error.TestFailed;
13}13}
14// run14// run
15// backend=stage1
\ No newline at end of file
15// backend=stage1
16// target=native
\ No newline at end of file
test/cases/safety/signed integer not fitting in cast to unsigned integer.zig +2-1
...@@ -15,4 +15,5 @@ fn unsigned_cast(x: i32) u32 {...@@ -15,4 +15,5 @@ fn unsigned_cast(x: i32) u32 {
15 return @intCast(u32, x);15 return @intCast(u32, x);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/signed shift left overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn shl(a: i16, b: u4) i16 {...@@ -15,4 +15,5 @@ fn shl(a: i16, b: u4) i16 {
15 return @shlExact(a, b);15 return @shlExact(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/signed shift right overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn shr(a: i16, b: u4) i16 {...@@ -15,4 +15,5 @@ fn shr(a: i16, b: u4) i16 {
15 return @shrExact(a, b);15 return @shrExact(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/signed-unsigned vector cast.zig +1
...@@ -17,3 +17,4 @@ pub fn main() !void {...@@ -17,3 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/slice sentinel mismatch - floats.zig +1
...@@ -17,3 +17,4 @@ pub fn main() !void {...@@ -17,3 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/slice sentinel mismatch - optional pointers.zig +1
...@@ -17,3 +17,4 @@ pub fn main() !void {...@@ -17,3 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/slice slice sentinel mismatch.zig +1
...@@ -16,3 +16,4 @@ pub fn main() !void {...@@ -16,3 +16,4 @@ pub fn main() !void {
16}16}
17// run17// run
18// backend=stage118// backend=stage1
19// target=native
test/cases/safety/slice with sentinel out of bounds.zig +1
...@@ -18,3 +18,4 @@ pub fn main() !void {...@@ -18,3 +18,4 @@ pub fn main() !void {
1818
19// run19// run
20// backend=stage120// backend=stage1
21// target=native
test/cases/safety/slicing null C pointer.zig +2-1
...@@ -13,4 +13,5 @@ pub fn main() !void {...@@ -13,4 +13,5 @@ pub fn main() !void {
13 return error.TestFailed;13 return error.TestFailed;
14}14}
15// run15// run
16// backend=stage1
\ No newline at end of file
16// backend=stage1
17// target=native
\ No newline at end of file
test/cases/safety/switch on corrupted enum value.zig +1
...@@ -23,3 +23,4 @@ pub fn main() !void {...@@ -23,3 +23,4 @@ pub fn main() !void {
2323
24// run24// run
25// backend=stage125// backend=stage1
26// target=native
test/cases/safety/switch on corrupted union value.zig +1
...@@ -23,3 +23,4 @@ pub fn main() !void {...@@ -23,3 +23,4 @@ pub fn main() !void {
2323
24// run24// run
25// backend=stage125// backend=stage1
26// target=native
test/cases/safety/truncating vector cast.zig +1
...@@ -17,3 +17,4 @@ pub fn main() !void {...@@ -17,3 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/unsigned integer not fitting in cast to signed integer - same bit count.zig +2-1
...@@ -12,4 +12,5 @@ pub fn main() !void {...@@ -12,4 +12,5 @@ pub fn main() !void {
12 return error.TestFailed;12 return error.TestFailed;
13}13}
14// run14// run
15// backend=stage1
\ No newline at end of file
15// backend=stage1
16// target=native
\ No newline at end of file
test/cases/safety/unsigned shift left overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn shl(a: u16, b: u4) u16 {...@@ -15,4 +15,5 @@ fn shl(a: u16, b: u4) u16 {
15 return @shlExact(a, b);15 return @shlExact(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/unsigned shift right overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn shr(a: u16, b: u4) u16 {...@@ -15,4 +15,5 @@ fn shr(a: u16, b: u4) u16 {
15 return @shrExact(a, b);15 return @shrExact(a, b);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/unsigned-signed vector cast.zig +1
...@@ -17,3 +17,4 @@ pub fn main() !void {...@@ -17,3 +17,4 @@ pub fn main() !void {
1717
18// run18// run
19// backend=stage119// backend=stage1
20// target=native
test/cases/safety/unwrap error.zig +2-1
...@@ -15,4 +15,5 @@ fn bar() !void {...@@ -15,4 +15,5 @@ fn bar() !void {
15 return error.Whatever;15 return error.Whatever;
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/value does not fit in shortening cast - u0.zig +2-1
...@@ -15,4 +15,5 @@ fn shorten_cast(x: u8) u0 {...@@ -15,4 +15,5 @@ fn shorten_cast(x: u8) u0 {
15 return @intCast(u0, x);15 return @intCast(u0, x);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/value does not fit in shortening cast.zig +2-1
...@@ -15,4 +15,5 @@ fn shorten_cast(x: i32) i8 {...@@ -15,4 +15,5 @@ fn shorten_cast(x: i32) i8 {
15 return @intCast(i8, x);15 return @intCast(i8, x);
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/vector integer addition overflow.zig +2-1
...@@ -16,4 +16,5 @@ fn add(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {...@@ -16,4 +16,5 @@ fn add(a: @Vector(4, i32), b: @Vector(4, i32)) @Vector(4, i32) {
16 return a + b;16 return a + b;
17}17}
18// run18// run
19// backend=stage1
\ No newline at end of file
19// backend=stage1
20// target=native
\ No newline at end of file
test/cases/safety/vector integer multiplication overflow.zig +2-1
...@@ -16,4 +16,5 @@ fn mul(a: @Vector(4, u8), b: @Vector(4, u8)) @Vector(4, u8) {...@@ -16,4 +16,5 @@ fn mul(a: @Vector(4, u8), b: @Vector(4, u8)) @Vector(4, u8) {
16 return a * b;16 return a * b;
17}17}
18// run18// run
19// backend=stage1
\ No newline at end of file
19// backend=stage1
20// target=native
\ No newline at end of file
test/cases/safety/vector integer negation overflow.zig +2-1
...@@ -15,4 +15,5 @@ fn neg(a: @Vector(4, i16)) @Vector(4, i16) {...@@ -15,4 +15,5 @@ fn neg(a: @Vector(4, i16)) @Vector(4, i16) {
15 return -a;15 return -a;
16}16}
17// run17// run
18// backend=stage1
\ No newline at end of file
18// backend=stage1
19// target=native
\ No newline at end of file
test/cases/safety/vector integer subtraction overflow.zig +2-1
...@@ -16,4 +16,5 @@ fn sub(a: @Vector(4, u32), b: @Vector(4, u32)) @Vector(4, u32) {...@@ -16,4 +16,5 @@ fn sub(a: @Vector(4, u32), b: @Vector(4, u32)) @Vector(4, u32) {
16 return a - b;16 return a - b;
17}17}
18// run18// run
19// backend=stage1
\ No newline at end of file
19// backend=stage1
20// target=native
\ No newline at end of file