aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-06-29 11:32:26 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-09-18 11:26:45 -0400
commit193604c837df75ab0c3fa5860f8b234263fe5b50 (patch)
treed96c52e9fd95d3e964fcc298505effc6bf3bffb3 /test/compile_errors.zig
parent9e4065fa738f040dd338c613409fc1089cc33580 (diff)
downloadzig-193604c837df75ab0c3fa5860f8b234263fe5b50.tar.gz
zig-193604c837df75ab0c3fa5860f8b234263fe5b50.zip
stage1: add @shuffle() shufflevector support
I change the semantics of the mask operand, to make it a little more flexible. There is no real danger in this because it is a compile-error if you do it the LLVM way (and there is an appropiate error to tell you this). v2: avoid problems with double-free
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 9d96d6f948..d9b4ee6a95 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -6485,6 +6485,19 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
);
cases.addTest(
+ "using LLVM syntax for @shuffle",
+ \\export fn entry() void {
+ \\ const v: @Vector(4, u32) = [4]u32{0, 1, 2, 3};
+ \\ const x: @Vector(4, u32) = [4]u32{4, 5, 6, 7};
+ \\ var z = @shuffle(u32, v, x, [8]i32{0, 1, 2, 3, 4, 5, 6, 7});
+ \\}
+ ,
+ "tmp.zig:4:39: error: mask index out of bounds",
+ "tmp.zig:4:39: note: when computing vector element at index 4",
+ "tmp.zig:4:39: 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));