aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior/array.zig')
-rw-r--r--test/behavior/array.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig
index 88a6ab947d..ec31d4a3fb 100644
--- a/test/behavior/array.zig
+++ b/test/behavior/array.zig
@@ -677,3 +677,13 @@ test "array of array agregate init" {
var b = [1][10]u32{a} ** 2;
try std.testing.expect(b[1][1] == 11);
}
+
+test "pointer to array has ptr field" {
+ const arr: *const [5]u32 = &.{ 10, 20, 30, 40, 50 };
+ try std.testing.expect(arr.ptr == @as([*]const u32, arr));
+ try std.testing.expect(arr.ptr[0] == 10);
+ try std.testing.expect(arr.ptr[1] == 20);
+ try std.testing.expect(arr.ptr[2] == 30);
+ try std.testing.expect(arr.ptr[3] == 40);
+ try std.testing.expect(arr.ptr[4] == 50);
+}