Skip to content

Commit 3961507

Browse files
committed
Fix check-builtins on Windows after alias changes
llvm-svn: 359835
1 parent 111df10 commit 3961507

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

compiler-rt/lib/builtins/comparedf2.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_dcmpun(fp_t a, fp_t b) { return __unorddf2(a, b); }
140140
COMPILER_RT_ALIAS(__unorddf2, __aeabi_dcmpun)
141141
#endif
142142
#endif
143+
144+
#if defined(_WIN32)
145+
// The alias mechanism doesn't work on Windows, so emit wrapper functions.
146+
int __eqdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
147+
int __ltdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
148+
int __nedf2(fp_t a, fp_t b) { return __ledf2(a, b); }
149+
int __gtdf2(fp_t a, fp_t b) { return __gedf2(a, b); }
150+
#endif

compiler-rt/lib/builtins/comparesf2.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_fcmpun(fp_t a, fp_t b) { return __unordsf2(a, b); }
140140
COMPILER_RT_ALIAS(__unordsf2, __aeabi_fcmpun)
141141
#endif
142142
#endif
143+
144+
#if defined(_WIN32)
145+
// The alias mechanism doesn't work on Windows, so emit wrapper functions.
146+
int __eqsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
147+
int __ltsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
148+
int __nesf2(fp_t a, fp_t b) { return __lesf2(a, b); }
149+
int __gtsf2(fp_t a, fp_t b) { return __gesf2(a, b); }
150+
#endif

compiler-rt/test/builtins/Unit/compiler_rt_logb_test.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ double cases[] = {
3535
-0.0, 0.0, 1, -2, 2, -0.5, 0.5,
3636
};
3737

38+
#ifndef __GLIBC_PREREQ
39+
#define __GLIBC_PREREQ(x, y) 0
40+
#endif
41+
3842
int main() {
3943
// Do not the run the compiler-rt logb test case if using GLIBC version
4044
// < 2.23. Older versions might not compute to the same value as the
4145
// compiler-rt value.
42-
#if !defined(__GLIBC__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 23))
46+
#if __GLIBC_PREREQ(2, 23)
4347
const unsigned N = sizeof(cases) / sizeof(cases[0]);
4448
unsigned i;
4549
for (i = 0; i < N; ++i) {

0 commit comments

Comments
 (0)