diff options
Diffstat (limited to 'lib/std/special/compiler_rt/floatunsitf_test.zig')
| -rw-r--r-- | lib/std/special/compiler_rt/floatunsitf_test.zig | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/std/special/compiler_rt/floatunsitf_test.zig b/lib/std/special/compiler_rt/floatunsitf_test.zig deleted file mode 100644 index 7ae7c43281..0000000000 --- a/lib/std/special/compiler_rt/floatunsitf_test.zig +++ /dev/null @@ -1,28 +0,0 @@ -const __floatunsitf = @import("floatunsitf.zig").__floatunsitf; - -fn test__floatunsitf(a: u32, expected_hi: u64, expected_lo: u64) !void { - const x = __floatunsitf(a); - - const x_repr = @bitCast(u128, x); - const x_hi = @intCast(u64, x_repr >> 64); - const x_lo = @truncate(u64, x_repr); - - if (x_hi == expected_hi and x_lo == expected_lo) { - return; - } - // nan repr - else if (expected_hi == 0x7fff800000000000 and expected_lo == 0x0) { - if ((x_hi & 0x7fff000000000000) == 0x7fff000000000000 and ((x_hi & 0xffffffffffff) > 0 or x_lo > 0)) { - return; - } - } - - @panic("__floatunsitf test failure"); -} - -test "floatunsitf" { - try test__floatunsitf(0x7fffffff, 0x401dfffffffc0000, 0x0); - try test__floatunsitf(0, 0x0, 0x0); - try test__floatunsitf(0xffffffff, 0x401efffffffe0000, 0x0); - try test__floatunsitf(0x12345678, 0x401b234567800000, 0x0); -} |
