| ... | ... | @@ -45,6 +45,18 @@ fn getArrayLen(a: []const u32) usize { |
| 45 | 45 | return a.len; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | test "runtime array concat with comptime slice" { |
| 49 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 50 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| 51 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |
| 52 | |
| 53 | var a: [1]u8 = .{1}; |
| 54 | const b = (comptime @as([]const u8, &.{0})) ++ &a; |
| 55 | const c = &a ++ (comptime @as([]const u8, &.{0})); |
| 56 | try std.testing.expectEqualSlices(u8, &.{ 0, 1 }, b); |
| 57 | try std.testing.expectEqualSlices(u8, &.{ 1, 0 }, c); |
| 58 | } |
| 59 | |
| 48 | 60 | test "array concat with undefined" { |
| 49 | 61 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 50 | 62 | if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; |