mirror of
https://github.com/ziglang/zig.git
synced 2025-12-29 17:43:17 +00:00
LLVM and compiler-rt must agree on how the parameters are passed, it turns out that in LLVM13 something changed and broke the test case for AArch64 systems. It has nothing to do with fma at all. Closes #9900
34 lines
709 B
Zig
34 lines
709 B
Zig
const expect = @import("std").testing.expect;
|
|
|
|
test "@mulAdd" {
|
|
comptime try testMulAdd();
|
|
try testMulAdd();
|
|
}
|
|
|
|
fn testMulAdd() !void {
|
|
{
|
|
var a: f16 = 5.5;
|
|
var b: f16 = 2.5;
|
|
var c: f16 = 6.25;
|
|
try expect(@mulAdd(f16, a, b, c) == 20);
|
|
}
|
|
{
|
|
var a: f32 = 5.5;
|
|
var b: f32 = 2.5;
|
|
var c: f32 = 6.25;
|
|
try expect(@mulAdd(f32, a, b, c) == 20);
|
|
}
|
|
{
|
|
var a: f64 = 5.5;
|
|
var b: f64 = 2.5;
|
|
var c: f64 = 6.25;
|
|
try expect(@mulAdd(f64, a, b, c) == 20);
|
|
}
|
|
{
|
|
var a: f16 = 5.5;
|
|
var b: f128 = 2.5;
|
|
var c: f128 = 6.25;
|
|
try expect(@mulAdd(f128, a, b, c) == 20);
|
|
}
|
|
}
|