@@ -189,6 +189,7 @@ use core::mem;
189
189
target_os = "linux",
190
190
test)))]
191
191
use std::mem;
192
+
192
193
use compiler_builtins::float::add::__adddf3;
193
194
194
195
fn mk_f64(x: u64) -> f64 {
@@ -828,11 +829,22 @@ fn divsi3() {
828
829
}
829
830
830
831
fn prologue ( ) -> & ' static str {
831
- "
832
+ r#"
833
+ #[cfg(all(target_arch = "arm",
834
+ not(any(target_env = "gnu", target_env = "musl")),
835
+ target_os = "linux",
836
+ test))]
837
+ use core::mem;
838
+ #[cfg(not(all(target_arch = "arm",
839
+ not(any(target_env = "gnu", target_env = "musl")),
840
+ target_os = "linux",
841
+ test)))]
842
+ use std::mem;
843
+
832
844
use compiler_builtins::int::sdiv::__divti3;
833
845
834
846
static TEST_CASES: &[((i128, i128), i128)] = &[
835
- "
847
+ "#
836
848
}
837
849
838
850
fn epilogue ( ) -> & ' static str {
@@ -842,7 +854,7 @@ static TEST_CASES: &[((i128, i128), i128)] = &[
842
854
#[test]
843
855
fn divti3() {
844
856
for &((a, b), c) in TEST_CASES {
845
- let c_ = __divti3(a, b);
857
+ let c_: i128 = unsafe { mem::transmute( __divti3(a, b)) } ;
846
858
assert_eq!(((a, b), c), ((a, b), c_));
847
859
}
848
860
}
@@ -1895,11 +1907,22 @@ fn modsi3() {
1895
1907
}
1896
1908
1897
1909
fn prologue ( ) -> & ' static str {
1898
- "
1910
+ r#"
1911
+ #[cfg(all(target_arch = "arm",
1912
+ not(any(target_env = "gnu", target_env = "musl")),
1913
+ target_os = "linux",
1914
+ test))]
1915
+ use core::mem;
1916
+ #[cfg(not(all(target_arch = "arm",
1917
+ not(any(target_env = "gnu", target_env = "musl")),
1918
+ target_os = "linux",
1919
+ test)))]
1920
+ use std::mem;
1921
+
1899
1922
use compiler_builtins::int::sdiv::__modti3;
1900
1923
1901
1924
static TEST_CASES: &[((i128, i128), i128)] = &[
1902
- "
1925
+ "#
1903
1926
}
1904
1927
1905
1928
fn epilogue ( ) -> & ' static str {
@@ -1909,7 +1932,7 @@ static TEST_CASES: &[((i128, i128), i128)] = &[
1909
1932
#[test]
1910
1933
fn modti3() {
1911
1934
for &((a, b), c) in TEST_CASES {
1912
- let c_ = __modti3(a, b);
1935
+ let c_: i128 = unsafe { mem::transmute( __modti3(a, b)) } ;
1913
1936
assert_eq!(((a, b), c), ((a, b), c_));
1914
1937
}
1915
1938
}
@@ -2913,11 +2936,22 @@ fn udivmodsi4() {
2913
2936
}
2914
2937
2915
2938
fn prologue ( ) -> & ' static str {
2916
- "
2939
+ r#"
2940
+ #[cfg(all(target_arch = "arm",
2941
+ not(any(target_env = "gnu", target_env = "musl")),
2942
+ target_os = "linux",
2943
+ test))]
2944
+ use core::mem;
2945
+ #[cfg(not(all(target_arch = "arm",
2946
+ not(any(target_env = "gnu", target_env = "musl")),
2947
+ target_os = "linux",
2948
+ test)))]
2949
+ use std::mem;
2950
+
2917
2951
use compiler_builtins::int::udiv::__udivmodti4;
2918
2952
2919
2953
static TEST_CASES: &[((u128, u128), (u128, u128))] = &[
2920
- "
2954
+ "#
2921
2955
}
2922
2956
2923
2957
fn epilogue ( ) -> & ' static str {
@@ -2928,7 +2962,7 @@ static TEST_CASES: &[((u128, u128), (u128, u128))] = &[
2928
2962
fn udivmodti4() {
2929
2963
for &((a, b), (c, rem)) in TEST_CASES {
2930
2964
let mut rem_ = 0;
2931
- let c_ = __udivmodti4(a, b, Some(&mut rem_));
2965
+ let c_: u128 = unsafe { mem::transmute( __udivmodti4(a, b, Some(&mut rem_))) } ;
2932
2966
assert_eq!(((a, b), (c, rem)), ((a, b), (c_, rem_)));
2933
2967
}
2934
2968
}
@@ -3036,11 +3070,22 @@ fn udivsi3() {
3036
3070
}
3037
3071
3038
3072
fn prologue ( ) -> & ' static str {
3039
- "
3073
+ r#"
3074
+ #[cfg(all(target_arch = "arm",
3075
+ not(any(target_env = "gnu", target_env = "musl")),
3076
+ target_os = "linux",
3077
+ test))]
3078
+ use core::mem;
3079
+ #[cfg(not(all(target_arch = "arm",
3080
+ not(any(target_env = "gnu", target_env = "musl")),
3081
+ target_os = "linux",
3082
+ test)))]
3083
+ use std::mem;
3084
+
3040
3085
use compiler_builtins::int::udiv::__udivti3;
3041
3086
3042
3087
static TEST_CASES: &[((u128, u128), u128)] = &[
3043
- "
3088
+ "#
3044
3089
}
3045
3090
3046
3091
fn epilogue ( ) -> & ' static str {
@@ -3050,7 +3095,7 @@ static TEST_CASES: &[((u128, u128), u128)] = &[
3050
3095
#[test]
3051
3096
fn udivti3() {
3052
3097
for &((a, b), c) in TEST_CASES {
3053
- let c_ = __udivti3(a, b);
3098
+ let c_: u128 = unsafe { mem::transmute( __udivti3(a, b)) } ;
3054
3099
assert_eq!(((a, b), c), ((a, b), c_));
3055
3100
}
3056
3101
}
@@ -3219,11 +3264,22 @@ fn umodsi3() {
3219
3264
}
3220
3265
3221
3266
fn prologue ( ) -> & ' static str {
3222
- "
3267
+ r#"
3268
+ #[cfg(all(target_arch = "arm",
3269
+ not(any(target_env = "gnu", target_env = "musl")),
3270
+ target_os = "linux",
3271
+ test))]
3272
+ use core::mem;
3273
+ #[cfg(not(all(target_arch = "arm",
3274
+ not(any(target_env = "gnu", target_env = "musl")),
3275
+ target_os = "linux",
3276
+ test)))]
3277
+ use std::mem;
3278
+
3223
3279
use compiler_builtins::int::udiv::__umodti3;
3224
3280
3225
3281
static TEST_CASES: &[((u128, u128), u128)] = &[
3226
- "
3282
+ "#
3227
3283
}
3228
3284
3229
3285
fn epilogue ( ) -> & ' static str {
@@ -3233,7 +3289,7 @@ static TEST_CASES: &[((u128, u128), u128)] = &[
3233
3289
#[test]
3234
3290
fn umodti3() {
3235
3291
for &((a, b), c) in TEST_CASES {
3236
- let c_ = __umodti3(a, b);
3292
+ let c_: u128 = unsafe { mem::transmute( __umodti3(a, b)) } ;
3237
3293
assert_eq!(((a, b), c), ((a, b), c_));
3238
3294
}
3239
3295
}
0 commit comments