diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 214881f74..8806f2333 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -439,10 +439,74 @@ extern { } export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 { - printf(c"0=%d\n", 0 as i32); // TODO: more tests + printf(c"\n"); + printf(c"0.0: %a\n", + 0.0 as f64); + printf(c"0e0: %a\n", + 0e0 as f64); + printf(c"0.0e0: %a\n", + 0.0e0 as f64); + printf(c"000000000000000000000000000000000000000000000000000000000.0e0: %a\n", + 000000000000000000000000000000000000000000000000000000000.0e0 as f64); + printf(c"0.000000000000000000000000000000000000000000000000000000000e0: %a\n", + 0.000000000000000000000000000000000000000000000000000000000e0 as f64); + printf(c"0.0e000000000000000000000000000000000000000000000000000000000: %a\n", + 0.0e000000000000000000000000000000000000000000000000000000000 as f64); + + printf(c"\n"); + + printf(c"0x1.0: %a\n", + 0x1.0 as f64); + printf(c"0x10.0: %a\n", + 0x10.0 as f64); + printf(c"0x100.0: %a\n", + 0x100.0 as f64); + printf(c"0x103.0: %a\n", + 0x103.0 as f64); + printf(c"0x103.7: %a\n", + 0x103.7 as f64); + printf(c"0x103.70: %a\n", + 0x103.70 as f64); + printf(c"0x103.70p4: %a\n", + 0x103.70p4 as f64); + printf(c"0x103.70p5: %a\n", + 0x103.70p5 as f64); + printf(c"0x103.70p+5: %a\n", + 0x103.70p+5 as f64); + printf(c"0x103.70p-5: %a\n", + 0x103.70p-5 as f64); + + printf(c"\n"); + + printf(c"0b10100.00010e0: %a\n", + 0b10100.00010e0 as f64); + printf(c"0o10700.00010e0: %a\n", + 0o10700.00010e0 as f64); + return 0; } - )SOURCE", "0=0\n"); + )SOURCE", R"OUTPUT( +0.0: 0x0p+0 +0e0: 0x0p+0 +0.0e0: 0x0p+0 +000000000000000000000000000000000000000000000000000000000.0e0: 0x0p+0 +0.000000000000000000000000000000000000000000000000000000000e0: 0x0p+0 +0.0e000000000000000000000000000000000000000000000000000000000: 0x0p+0 + +0x1.0: 0x1p+0 +0x10.0: 0x1p+4 +0x100.0: 0x1p+8 +0x103.0: 0x1.03p+8 +0x103.7: 0x1.037p+8 +0x103.70: 0x1.037p+8 +0x103.70p4: 0x1.037p+12 +0x103.70p5: 0x1.037p+13 +0x103.70p+5: 0x1.037p+13 +0x103.70p-5: 0x1.037p+3 + +0b10100.00010e0: 0x1.41p+4 +0o10700.00010e0: 0x1.1c0001p+12 +)OUTPUT"); add_simple_case("structs", R"SOURCE( use "std.zig";