zig/test/incremental/delete_comptime_decls
mlugg 14ccbbef9f
test: add x86_64-windows-cbe target to incremental cases
Throw another target in there just to spice things up a little!

Running the incremental cases with the C backend is pretty slow due to
the need to recompile the whole output from scratch on every update; for
this reason, we probably don't want to keep many of these targeting CBE
long-term. However, for now, while we have relatively few tests and
things are still changing quite a lot, it's better to have this little
bit of extra test coverage.
2024-10-05 20:52:26 +01:00

41 lines
846 B
Plaintext

#target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
#update=initial version
#file=main.zig
pub fn main() void {}
comptime {
var array = [_:0]u8{ 1, 2, 3, 4 };
const src_slice: [:0]u8 = &array;
const slice = src_slice[2..6];
_ = slice;
}
comptime {
var array = [_:0]u8{ 1, 2, 3, 4 };
const slice = array[2..6];
_ = slice;
}
comptime {
var array = [_]u8{ 1, 2, 3, 4 };
const slice = array[2..5];
_ = slice;
}
comptime {
var array = [_:0]u8{ 1, 2, 3, 4 };
const slice = array[3..2];
_ = slice;
}
#expect_error=ignored
#update=delete and modify comptime decls
#file=main.zig
pub fn main() void {}
comptime {
const x: [*c]u8 = null;
var runtime_len: usize = undefined;
runtime_len = 0;
const y = x[0..runtime_len];
_ = y;
}
#expect_error=ignored