implement vector negation
also fix vector behavior tests, they weren't actually testing runtime vectors, but now they are. See #903
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
const tests = @import("tests.zig");
|
||||
|
||||
pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
cases.addTest(
|
||||
"comptime vector overflow shows the index",
|
||||
\\comptime {
|
||||
\\ var a: @Vector(4, u8) = []u8{ 1, 2, 255, 4 };
|
||||
\\ var b: @Vector(4, u8) = []u8{ 5, 6, 1, 8 };
|
||||
\\ var x = a + b;
|
||||
\\}
|
||||
,
|
||||
".tmp_source.zig:4:15: error: operation caused overflow",
|
||||
".tmp_source.zig:4:15: note: when computing vector element at index 2",
|
||||
);
|
||||
|
||||
cases.addTest(
|
||||
"packed struct with fields of not allowed types",
|
||||
\\const A = packed struct {
|
||||
|
||||
Reference in New Issue
Block a user