diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/cast.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cases/cast.zig b/test/cases/cast.zig index 3ab5834d4f..a7bef9ded5 100644 --- a/test/cases/cast.zig +++ b/test/cases/cast.zig @@ -15,3 +15,13 @@ fn numLitIntToPtrCast() { const vga_mem = (&u16)(0xB8000); assert(usize(vga_mem) == 0xB8000); } + +fn pointerReinterpretConstFloatToInt() { + @setFnTest(this); + + const float: f64 = 5.99999999999994648725e-01; + const float_ptr = &float; + const int_ptr = (&i32)(float_ptr); + const int_val = *int_ptr; + assert(int_val == 858993411); +} |
