aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-03-26 03:56:54 +0000
committermlugg <mlugg@mlugg.co.uk>2024-03-26 13:48:06 +0000
commit152a2ceaf738301cd59165a4f17d915391321bdc (patch)
treef2239a36d9d2ce92bfaf34742620ce74ec7defb5 /test/behavior/basic.zig
parent884d957b6c291961536c10401f60264da26cba30 (diff)
downloadzig-152a2ceaf738301cd59165a4f17d915391321bdc.tar.gz
zig-152a2ceaf738301cd59165a4f17d915391321bdc.zip
compiler: audit uses of `ptr.addr` in the frontend
This commit also performs some refactors to `TypedValue.print` in preparation for improved comptime pointer access logic. Once that logic exists, `TypedValue.print` can use Sema to access pointers for more helpful printing. This commit also implements proposal #19435, because the existing logic there relied on some blatantly incorrect code in `Value.sliceLen`. Resolves: #19435
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig25
1 files changed, 0 insertions, 25 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index e76416ddb0..c9abaf9c8b 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -693,31 +693,6 @@ test "string concatenation" {
try expect(b[len] == 0);
}
-fn manyptrConcat(comptime s: [*:0]const u8) [*:0]const u8 {
- return "very " ++ s;
-}
-
-test "comptime manyptr concatenation" {
- if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
- if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
- if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
-
- const s = "epic";
- const actual = manyptrConcat(s);
- const expected = "very epic";
-
- const len = mem.len(actual);
- const len_with_null = len + 1;
- {
- var i: u32 = 0;
- while (i < len_with_null) : (i += 1) {
- try expect(actual[i] == expected[i]);
- }
- }
- try expect(actual[len] == 0);
- try expect(expected[len] == 0);
-}
-
test "result location is optional inside error union" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO