aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/vector.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-02-18 05:25:36 +0100
committerAlex Rønne Petersen <alex@alexrp.com>2025-06-05 06:12:00 +0200
commit9d534790ebc869ec933e932abe4be8b9e3593bbc (patch)
tree70652dde381fd0c0d536d8e7665e725e0924bb51 /test/behavior/vector.zig
parent14873f9a3434a0d753ca8438f389a7931956cf26 (diff)
downloadzig-9d534790ebc869ec933e932abe4be8b9e3593bbc.tar.gz
zig-9d534790ebc869ec933e932abe4be8b9e3593bbc.zip
std.Target: Introduce Cpu convenience functions for feature tests.
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
Diffstat (limited to 'test/behavior/vector.zig')
-rw-r--r--test/behavior/vector.zig6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig
index a8b531bcca..bafec68b26 100644
--- a/test/behavior/vector.zig
+++ b/test/behavior/vector.zig
@@ -251,7 +251,7 @@ test "array to vector with element type coercion" {
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt == .coff and
- !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .f16c)) return error.SkipZigTest;
+ !comptime builtin.cpu.has(.x86, .f16c)) return error.SkipZigTest;
const S = struct {
fn doTheTest() !void {
@@ -1259,9 +1259,7 @@ test "byte vector initialized in inline function" {
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
- if (comptime builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64 and
- std.Target.x86.featureSetHas(builtin.cpu.features, .avx512f))
- {
+ if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .x86_64 and comptime builtin.cpu.has(.x86, .avx512f)) {
// TODO https://github.com/ziglang/zig/issues/13279
return error.SkipZigTest;
}