aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/memops/type-punning-int2flt.c
diff options
context:
space:
mode:
Diffstat (limited to 'validation/memops/type-punning-int2flt.c')
-rw-r--r--validation/memops/type-punning-int2flt.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/validation/memops/type-punning-int2flt.c b/validation/memops/type-punning-int2flt.c
new file mode 100644
index 00000000..061b7423
--- /dev/null
+++ b/validation/memops/type-punning-int2flt.c
@@ -0,0 +1,19 @@
+union u {
+ int i;
+ float f;
+};
+
+static float foo(void)
+{
+ union u u = { .i = 3 };
+ return u.f;
+}
+
+/*
+ * check-name: type-punning-int-to-float
+ * check description: must not infer the float value from the int
+ * check-command: test-linearize $file
+ *
+ * check-output-ignore
+ * check-output-contains: load\\.
+ */