Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c9009ae

Browse files
authoredNov 8, 2024
Rollup merge of #132696 - fortanix:raoul/rte-235-fix_fmodl_missing_symbol_issue, r=tgross35
Compile `test_num_f128` conditionally on `reliable_f128_math` config With #132434 merged, our internal SGX CI started failing with: ``` 05:27:34 = note: rust-lld: error: undefined symbol: fmodl 05:27:34 >>> referenced by arith.rs:617 (core/src/ops/arith.rs:617) 05:27:34 >>> /home/jenkins/workspace/rust-sgx-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/std-5d5f11eb008c9091.std.d8141acc61ab7ac8-cgu.10.rcgu.o:(std::num::test_num::h7dd9449f6c01fde8) 05:27:34 >>> did you mean: fmodf 05:27:34 >>> defined in: /home/jenkins/workspace/rust-sgx-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/libcompiler_builtins-0376f439a2ebf305.rlib(compiler_builtins-0376f439a2ebf305.compiler_builtins.c22db39d25d6f802-cgu.148.rcgu.o) ``` This originated from the `test_num_f128` test not having the required conditional compilation. This PR fixes that issue. cc: ````@jethrogb,```` ````@workingjubilee````
2 parents 0683e03 + 0720880 commit c9009ae

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed
 

‎library/std/src/f128/tests.rs

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
#![cfg(reliable_f128)]
33

44
use crate::f128::consts;
5-
use crate::num::{FpCategory as Fp, *};
5+
use crate::num::FpCategory as Fp;
6+
#[cfg(reliable_f128_math)]
7+
use crate::ops::Rem;
8+
use crate::ops::{Add, Div, Mul, Sub};
69

710
// Note these tolerances make sense around zero, but not for more extreme exponents.
811

@@ -53,7 +56,22 @@ macro_rules! assert_f128_biteq {
5356

5457
#[test]
5558
fn test_num_f128() {
56-
test_num(10f128, 2f128);
59+
// FIXME(f16_f128): replace with a `test_num` call once the required `fmodl`/`fmodf128`
60+
// function is available on all platforms.
61+
let ten = 10f128;
62+
let two = 2f128;
63+
assert_eq!(ten.add(two), ten + two);
64+
assert_eq!(ten.sub(two), ten - two);
65+
assert_eq!(ten.mul(two), ten * two);
66+
assert_eq!(ten.div(two), ten / two);
67+
}
68+
69+
#[test]
70+
#[cfg(reliable_f128_math)]
71+
fn test_num_f128_rem() {
72+
let ten = 10f128;
73+
let two = 2f128;
74+
assert_eq!(ten.rem(two), ten % two);
5775
}
5876

5977
#[test]

0 commit comments

Comments
 (0)
Failed to load comments.