Merge pull request #287 from alexcrichton/reenable-mips

Enable historically segfaulting tests on MIPS
This commit is contained in:
Alex Crichton 2019-05-02 16:44:40 -05:00 committed by GitHub
commit fd7d1b0a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 55 deletions

View File

@ -594,14 +594,12 @@ fn main() {
}"); }");
gen(|(a, b): (MyI128, MyI128)| Some(a.0.wrapping_mul(b.0)), gen(|(a, b): (MyI128, MyI128)| Some(a.0.wrapping_mul(b.0)),
"builtins::int::mul::__multi3(a, b)"); "builtins::int::mul::__multi3(a, b)");
if !target_arch_mips { // FIXME(#137) gen(|(a, b): (MyI128, MyI128)| Some(a.0.overflowing_mul(b.0)),
gen(|(a, b): (MyI128, MyI128)| Some(a.0.overflowing_mul(b.0)), "{
"{ let mut o = 2;
let mut o = 2; let c = builtins::int::mul::__muloti4(a, b, &mut o);
let c = builtins::int::mul::__muloti4(a, b, &mut o); (c, match o { 0 => false, 1 => true, _ => panic!() })
(c, match o { 0 => false, 1 => true, _ => panic!() }) }");
}");
}
// int/sdiv.rs // int/sdiv.rs
gen(|(a, b): (MyI64, MyI64)| { gen(|(a, b): (MyI64, MyI64)| {
@ -658,24 +656,22 @@ fn main() {
} }
}, },
"builtins::int::sdiv::__moddi3(a, b)"); "builtins::int::sdiv::__moddi3(a, b)");
if !target_arch_mips { // FIXME(#137) gen(|(a, b): (MyI128, MyI128)| {
gen(|(a, b): (MyI128, MyI128)| { if b.0 == 0 {
if b.0 == 0 { None
None } else {
} else { Some(a.0 / b.0)
Some(a.0 / b.0) }
} },
}, "builtins::int::sdiv::__divti3(a, b)");
"builtins::int::sdiv::__divti3(a, b)"); gen(|(a, b): (MyI128, MyI128)| {
gen(|(a, b): (MyI128, MyI128)| { if b.0 == 0 {
if b.0 == 0 { None
None } else {
} else { Some(a.0 % b.0)
Some(a.0 % b.0) }
} },
}, "builtins::int::sdiv::__modti3(a, b)");
"builtins::int::sdiv::__modti3(a, b)");
}
// int/shift.rs // int/shift.rs
gen(|(a, b): (MyU64, MyU32)| Some(a.0 << (b.0 % 64)), gen(|(a, b): (MyU64, MyU32)| Some(a.0 << (b.0 % 64)),
@ -746,35 +742,33 @@ fn main() {
} }
}, },
"builtins::int::udiv::__umoddi3(a, b)"); "builtins::int::udiv::__umoddi3(a, b)");
if !target_arch_mips { // FIXME(#137) gen(|(a, b): (MyU128, MyU128)| {
gen(|(a, b): (MyU128, MyU128)| { if b.0 == 0 {
if b.0 == 0 { None
None } else {
} else { Some(a.0 / b.0)
Some(a.0 / b.0) }
} },
}, "builtins::int::udiv::__udivti3(a, b)");
"builtins::int::udiv::__udivti3(a, b)"); gen(|(a, b): (MyU128, MyU128)| {
gen(|(a, b): (MyU128, MyU128)| { if b.0 == 0 {
if b.0 == 0 { None
None } else {
} else { Some(a.0 % b.0)
Some(a.0 % b.0) }
} },
}, "builtins::int::udiv::__umodti3(a, b)");
"builtins::int::udiv::__umodti3(a, b)"); gen(|(a, b): (MyU128, MyU128)| {
gen(|(a, b): (MyU128, MyU128)| { if b.0 == 0 {
if b.0 == 0 { None
None } else {
} else { Some((a.0 / b.0, a.0 % b.0))
Some((a.0 / b.0, a.0 % b.0)) }
} },
}, "{
"{ let mut r = 0;
let mut r = 0; (builtins::int::udiv::__udivmodti4(a, b, Some(&mut r)), r)
(builtins::int::udiv::__udivmodti4(a, b, Some(&mut r)), r) }");
}");
}
} }
macro_rules! gen_float { macro_rules! gen_float {