Fix check-builtins on Windows after alias changes

llvm-svn: 359835
This commit is contained in:
Reid Kleckner 2019-05-02 22:11:55 +00:00
parent 111df108e6
commit 3961507ba1
3 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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) {