diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-18 16:35:57 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-18 16:35:57 -0400 |
| commit | 86209e1a9259dca40803e56d612beacf5a35855c (patch) | |
| tree | 21e2b617a7cd424f82e040b94014b1c176dcf63b /test/compile_errors.zig | |
| parent | 914ad1ec2eff4ea9061804ad0da9cde7dd6543b6 (diff) | |
| parent | ef0f3ba905e992556a60f935cbb7cb30cf1f27db (diff) | |
| download | zig-86209e1a9259dca40803e56d612beacf5a35855c.tar.gz zig-86209e1a9259dca40803e56d612beacf5a35855c.zip | |
Merge branch 'merge-shawnl-simd5'
This is the first 3 commits of #2945, plus my fixups.
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 6365ca64cb..1fe3fc58ab 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -6485,13 +6485,26 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { ); cases.addTest( + "@shuffle with selected index past first vector length", + \\export fn entry() void { + \\ const v: @Vector(4, u32) = [4]u32{ 10, 11, 12, 13 }; + \\ const x: @Vector(4, u32) = [4]u32{ 14, 15, 16, 17 }; + \\ var z = @shuffle(u32, v, x, [8]i32{ 0, 1, 2, 3, 7, 6, 5, 4 }); + \\} + , + "tmp.zig:4:39: error: mask index '4' has out-of-bounds selection", + "tmp.zig:4:27: note: selected index '7' out of bounds of @Vector(4, u32)", + "tmp.zig:4:30: note: selections from the second vector are specified with negative numbers", + ); + + cases.addTest( "nested vectors", \\export fn entry() void { \\ const V = @Vector(4, @Vector(4, u8)); \\ var v: V = undefined; \\} , - "tmp.zig:2:26: error: vector element type must be integer, float, or pointer; '@Vector(4, u8)' is invalid", + "tmp.zig:2:26: error: vector element type must be integer, float, bool, or pointer; '@Vector(4, u8)' is invalid", ); cases.add("compileLog of tagged enum doesn't crash the compiler", |
