diff options
Diffstat (limited to 'tests/conformance/5-declarations')
| -rw-r--r-- | tests/conformance/5-declarations/global_float_init_f32_and_list.zc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/conformance/5-declarations/global_float_init_f32_and_list.zc b/tests/conformance/5-declarations/global_float_init_f32_and_list.zc new file mode 100644 index 0000000..57df35b --- /dev/null +++ b/tests/conformance/5-declarations/global_float_init_f32_and_list.zc @@ -0,0 +1,8 @@ +// expect: 1/1/ +// spec 5.3.2 and appendix b.2.7: float globals take a float literal initializer +include rt; +void pn(int x) { rt.put_n(x); rt.put_c(10); } +float a = 0.25, b = 2.5; +f32 c = 0.5; +fn main() { pn(a + b == 2.75); pn(c * 4.0 == 2.0); return 0; } +// zc0: skip |
