Skip to content

Commit bf65a37

Browse files
committed
Add cmp test
1 parent a4719b3 commit bf65a37

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

testcrate/tests/cmp.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ macro_rules! cmp {
2828
fn float_comparisons() {
2929
use compiler_builtins::float::cmp::{
3030
__eqdf2, __eqsf2, __gedf2, __gesf2, __gtdf2, __gtsf2, __ledf2, __lesf2, __ltdf2, __ltsf2,
31-
__nedf2, __nesf2, __unorddf2, __unordsf2,
31+
__nedf2, __nesf2, __unordtf2, __unorddf2, __unordsf2,
32+
__lttf2, __letft, __eqtf2, __getf2, __gttf2, __netf2
3233
};
3334

3435
fuzz_float_2(N, |x: f32, y: f32| {
@@ -53,6 +54,17 @@ fn float_comparisons() {
5354
1, __nedf2;
5455
);
5556
});
57+
fuzz_float_2(N, |x: f128, y: f128| {
58+
assert_eq!(__unordtf2(x, y) != 0, x.is_nan() || y.is_nan());
59+
cmp!(x, y,
60+
1, __lttf2;
61+
1, __letf2;
62+
1, __eqtf2;
63+
-1, __getf2;
64+
-1, __gttf2;
65+
1, __netf2;
66+
);
67+
});
5668
}
5769

5870
macro_rules! cmp2 {

0 commit comments

Comments
 (0)