summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/regression/Makefile3
-rw-r--r--test/regression/singlefloats.c32
2 files changed, 34 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index 57d5db3..22e5433 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -30,7 +30,8 @@ TESTS_DIFF=NaNs
EXTRAS=annot1 commaprec expr2 expr3 expr4 extern1 funct2 funptr1 \
pragmas ptrs1 ptrs2 struct1 struct2 struct3 \
- struct4 struct5 struct6 struct9 struct10 types1 seqops
+ struct4 struct5 struct6 struct9 struct10 types1 seqops \
+ singlefloats
# Test known to fail
FAILURES=funct1
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;
+}