summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-05-02 22:11:55 +0000
committerReid Kleckner <rnk@google.com>2019-05-02 22:11:55 +0000
commit812af4fe74be9ff410d919ffe183e85842b41ab0 (patch)
treebbce2516f473a5ec2496adfe08c322c4fd8540ef
parent145ecb53e9feb5ad2296843d5cc5a0edcd0e9fbd (diff)
downloadcompiler-rt-812af4fe74be9ff410d919ffe183e85842b41ab0.tar.gz
Fix check-builtins on Windows after alias changes
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359835 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/builtins/comparedf2.c8
-rw-r--r--lib/builtins/comparesf2.c8
-rw-r--r--test/builtins/Unit/compiler_rt_logb_test.c6
3 files changed, 21 insertions, 1 deletions
diff --git a/lib/builtins/comparedf2.c b/lib/builtins/comparedf2.c
index b1fcdb42f..9f059785a 100644
--- a/lib/builtins/comparedf2.c
+++ b/lib/builtins/comparedf2.c
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_dcmpun(fp_t a, fp_t b) { return __unorddf2(a, b); }
COMPILER_RT_ALIAS(__unorddf2, __aeabi_dcmpun)
#endif
#endif
+
+#if defined(_WIN32)
+// The alias mechanism doesn't work on Windows, so emit wrapper functions.
+int __eqdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
+int __ltdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
+int __nedf2(fp_t a, fp_t b) { return __ledf2(a, b); }
+int __gtdf2(fp_t a, fp_t b) { return __gedf2(a, b); }
+#endif
diff --git a/lib/builtins/comparesf2.c b/lib/builtins/comparesf2.c
index c00f0de02..edf40d6d1 100644
--- a/lib/builtins/comparesf2.c
+++ b/lib/builtins/comparesf2.c
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_fcmpun(fp_t a, fp_t b) { return __unordsf2(a, b); }
COMPILER_RT_ALIAS(__unordsf2, __aeabi_fcmpun)
#endif
#endif
+
+#if defined(_WIN32)
+// The alias mechanism doesn't work on Windows, so emit wrapper functions.
+int __eqsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
+int __ltsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
+int __nesf2(fp_t a, fp_t b) { return __lesf2(a, b); }
+int __gtsf2(fp_t a, fp_t b) { return __gesf2(a, b); }
+#endif
diff --git a/test/builtins/Unit/compiler_rt_logb_test.c b/test/builtins/Unit/compiler_rt_logb_test.c
index 474125325..c36b19ca3 100644
--- a/test/builtins/Unit/compiler_rt_logb_test.c
+++ b/test/builtins/Unit/compiler_rt_logb_test.c
@@ -35,11 +35,15 @@ double cases[] = {
-0.0, 0.0, 1, -2, 2, -0.5, 0.5,
};
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
int main() {
// Do not the run the compiler-rt logb test case if using GLIBC version
// < 2.23. Older versions might not compute to the same value as the
// compiler-rt value.
-#if !defined(__GLIBC__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 23))
+#if __GLIBC_PREREQ(2, 23)
const unsigned N = sizeof(cases) / sizeof(cases[0]);
unsigned i;
for (i = 0; i < N; ++i) {