summaryrefslogtreecommitdiff
path: root/test/regression/singlefloats.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regression/singlefloats.c')
-rw-r--r--test/regression/singlefloats.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/regression/singlefloats.c b/test/regression/singlefloats.c
new file mode 100644
index 0000000..9e3c582
--- /dev/null
+++ b/test/regression/singlefloats.c
@@ -0,0 +1,32 @@
+/* This caused an internal compiler error in CompCert 2.2.
+ (RTLtyping failure, because y is used both as a float32 and a float64). */
+
+typedef union
+{
+ float value;
+ unsigned int word;
+} shape;
+
+float
+expf(float x)
+{
+ float y,hi;
+
+ y = 1/hi;
+
+ shape A;
+ A.value = y;
+
+ shape B;
+ B.word = A.word;
+ y = B.value;
+
+ return y;
+}
+
+/* Another internal compiler error in CompCert 2.2. */
+
+void store(volatile float * p, double x)
+{
+ *p = x + 1.0;
+}