mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 07:33:08 +00:00
* Identify the ones that are passing and stop skipping them. * Flatten out the main behavior.zig file and have each individual test disable itself if it is not passing.
20 lines
896 B
Zig
20 lines
896 B
Zig
const builtin = @import("builtin");
|
|
const std = @import("std");
|
|
|
|
test "uses correct LLVM builtin" {
|
|
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
|
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
|
|
|
|
var x: u32 = 0x1;
|
|
var y: @Vector(4, u32) = [_]u32{ 0x1, 0x1, 0x1, 0x1 };
|
|
// The stage1 compiler used to call the same builtin function for both
|
|
// scalar and vector inputs, causing the LLVM module verification to fail.
|
|
var a = @clz(u32, x);
|
|
var b = @clz(u32, y);
|
|
try std.testing.expectEqual(@as(u6, 31), a);
|
|
try std.testing.expectEqual([_]u6{ 31, 31, 31, 31 }, b);
|
|
}
|