summaryrefslogtreecommitdiff
path: root/debian/patches/0001-Disable-floating-point-test-for-ARM-soft-float.patch
blob: 074e0cc8672ad22217e2eb9ce812a8b193335430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 17f01d0d80c45bfc1dda7aa4e9ee7d7d257c9000 Mon Sep 17 00:00:00 2001
From: Matteo Cypriani <mcy@lm7.fr>
Date: Fri, 5 Sep 2014 23:22:56 -0400
Subject: Disable floating-point test for ARM soft-float

tcc is not yet capable of doing softfloat floating-point operations on
ARM, therefore we disable this test for these platforms. Note that tcc
displays a warning to warn ARM users about this limitation.

Origin: vendor
Forwarded: no
Last-Update: 2014-10-07
---
 tests/Makefile        | 10 ++++++++--
 tests/tcctest.c       |  2 ++
 tests/tests2/Makefile |  9 +++++++--
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index e6c5660..f2813ba 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -214,10 +214,16 @@ abitest-cc$(EXESUF): abitest.c $(top_builddir)/$(LIBTCC)
 abitest-tcc$(EXESUF): abitest.c libtcc.c
 	$(TCC) -o $@ $^ $(CPPFLAGS) $(CFLAGS) $(NATIVE_DEFINES) -DONE_SOURCE $(LIBS) $(LDFLAGS) -I$(top_srcdir)
 
-abitest: abitest-cc$(EXESUF) abitest-tcc$(EXESUF)
+ABITESTS := abitest-cc$(EXESUF)
+ifneq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
+	ABITESTS += abitest-tcc$(EXESUF)
+endif
+
+abitest: $(ABITESTS)
 	@echo ------------ $@ ------------
 	./abitest-cc$(EXESUF) lib_path=.. include="$(top_srcdir)/include"
-	./abitest-tcc$(EXESUF) lib_path=.. include="$(top_srcdir)/include"
+	if [ $(CONFIG_arm_eabi) != "yes" ]; then \
+		./abitest-tcc$(EXESUF) lib_path=.. include="$(top_srcdir)/include"; fi
 
 vla_test$(EXESUF): vla_test.c
 	$(TCC) -o $@ $^ $(CPPFLAGS) $(CFLAGS)
diff --git a/tests/tcctest.c b/tests/tcctest.c
index cc8ffd8..78bb785 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -1760,6 +1760,7 @@ double ftab1[3] = { 1.2, 3.4, -5.6 };
 
 void float_test(void)
 {
+#if !defined(__arm__) || defined(__ARM_PCS_VFP)
     float fa, fb;
     double da, db;
     int a;
@@ -1785,6 +1786,7 @@ void float_test(void)
     b = 4000000000;
     db = b;
     printf("db = %f\n", db);
+#endif
 }
 
 int fib(int n)
diff --git a/tests/tests2/Makefile b/tests/tests2/Makefile
index 66d2f5a..4da68d9 100644
--- a/tests/tests2/Makefile
+++ b/tests/tests2/Makefile
@@ -41,8 +41,13 @@ TESTS =	\
  18_include.test \
  19_pointer_arithmetic.test \
  20_pointer_comparison.test \
- 21_char_array.test \
- 22_floating_point.test \
+ 21_char_array.test
+
+ifneq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
+	TESTS += 22_floating_point.test
+endif
+
+TESTS += \
  23_type_coercion.test \
  24_math_library.test \
  25_quicksort.test \