aboutsummaryrefslogtreecommitdiff
path: root/test/initializer-cast-float-int.qbe
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-10-25 15:59:54 -0700
committerMichael Forney <mforney@mforney.org>2021-10-25 17:01:43 -0700
commite79005956c888e7bafb602df1137f881b34775ec (patch)
tree2267161bfb9b9cc5e065691cb75ef9679ca4b5ad /test/initializer-cast-float-int.qbe
parent9540626e5793583b6feb36d025dc640c7cb97cc8 (diff)
eval: Fix int-to-float conversions
Also, add bounds checks for float-to-int conversions. If the integer part can't be represented in the result type, C behavior is undefined. Although this means the result is arbitrary, we need to avoid undefined behavior in cproc itself when given such a program as input.
Diffstat (limited to 'test/initializer-cast-float-int.qbe')
-rw-r--r--test/initializer-cast-float-int.qbe1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/initializer-cast-float-int.qbe b/test/initializer-cast-float-int.qbe
new file mode 100644
index 0000000..675fc96
--- /dev/null
+++ b/test/initializer-cast-float-int.qbe
@@ -0,0 +1 @@
+export data $x = align 4 { w 18446744073709551615, }