blob: a832f14cefbd690bee55bdca9d8942e70f7d6a13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const expect = @import("std").testing.expect;
const builtin = @import("builtin");
fn a(b: []u3, c: u3) void {
switch (c) {
0...1 => b[c] = c,
2...3 => b[c] = c,
4...7 => |d| b[d] = c,
}
}
test {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
var arr: [8]u3 = undefined;
a(&arr, 5);
try expect(arr[5] == 5);
}
|