mirror of
https://github.com/ziglang/zig.git
synced 2025-12-12 01:03:13 +00:00
The cache entry must take into account the fact some functions operate on scalar types and some other on vectors of scalar types. Fixes #10147
13 lines
463 B
Zig
13 lines
463 B
Zig
const std = @import("std");
|
|
|
|
test "uses correct LLVM builtin" {
|
|
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);
|
|
}
|