aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior')
-rw-r--r--test/behavior/prefetch.zig27
1 files changed, 14 insertions, 13 deletions
diff --git a/test/behavior/prefetch.zig b/test/behavior/prefetch.zig
index cd4d8c5aba..d4baa649d0 100644
--- a/test/behavior/prefetch.zig
+++ b/test/behavior/prefetch.zig
@@ -4,27 +4,28 @@ const std = @import("std");
test "@prefetch()" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
- var a: u32 = 42;
+ var a: [2]u32 = .{ 42, 42 };
+ var a_len = a.len;
@prefetch(&a, .{});
- @prefetch(&a, .{ .rw = .read, .locality = 3, .cache = .data });
+ @prefetch(&a[0], .{ .rw = .read, .locality = 3, .cache = .data });
@prefetch(&a, .{ .rw = .read, .locality = 2, .cache = .data });
- @prefetch(&a, .{ .rw = .read, .locality = 1, .cache = .data });
- @prefetch(&a, .{ .rw = .read, .locality = 0, .cache = .data });
+ @prefetch(a[0..].ptr, .{ .rw = .read, .locality = 1, .cache = .data });
+ @prefetch(a[0..a_len], .{ .rw = .read, .locality = 0, .cache = .data });
- @prefetch(&a, .{ .rw = .write, .locality = 3, .cache = .data });
+ @prefetch(&a[0], .{ .rw = .write, .locality = 3, .cache = .data });
@prefetch(&a, .{ .rw = .write, .locality = 2, .cache = .data });
- @prefetch(&a, .{ .rw = .write, .locality = 1, .cache = .data });
- @prefetch(&a, .{ .rw = .write, .locality = 0, .cache = .data });
+ @prefetch(a[0..].ptr, .{ .rw = .write, .locality = 1, .cache = .data });
+ @prefetch(a[0..a_len], .{ .rw = .write, .locality = 0, .cache = .data });
- @prefetch(&a, .{ .rw = .read, .locality = 3, .cache = .instruction });
+ @prefetch(&a[0], .{ .rw = .read, .locality = 3, .cache = .instruction });
@prefetch(&a, .{ .rw = .read, .locality = 2, .cache = .instruction });
- @prefetch(&a, .{ .rw = .read, .locality = 1, .cache = .instruction });
- @prefetch(&a, .{ .rw = .read, .locality = 0, .cache = .instruction });
+ @prefetch(a[0..].ptr, .{ .rw = .read, .locality = 1, .cache = .instruction });
+ @prefetch(a[0..a_len], .{ .rw = .read, .locality = 0, .cache = .instruction });
- @prefetch(&a, .{ .rw = .write, .locality = 3, .cache = .instruction });
+ @prefetch(&a[0], .{ .rw = .write, .locality = 3, .cache = .instruction });
@prefetch(&a, .{ .rw = .write, .locality = 2, .cache = .instruction });
- @prefetch(&a, .{ .rw = .write, .locality = 1, .cache = .instruction });
- @prefetch(&a, .{ .rw = .write, .locality = 0, .cache = .instruction });
+ @prefetch(a[0..].ptr, .{ .rw = .write, .locality = 1, .cache = .instruction });
+ @prefetch(a[0..a_len], .{ .rw = .write, .locality = 0, .cache = .instruction });
}