Check trap code in test suite assertions

This commit is contained in:
Artur Jamro
2019-09-25 10:34:37 -07:00
committed by Dan Gohman
parent b0fe01397b
commit 286d2515f9
7 changed files with 66 additions and 20 deletions

View File

@@ -203,6 +203,11 @@ fn handle_module(
}),
};
let mut flag_builder = settings::builder();
// There are two possible traps for division, and this way
// we get the proper one if code traps.
flag_builder.enable("avoid_div_traps").unwrap();
if enable_simd {
flag_builder.enable("enable_simd").unwrap();
}

View File

@@ -258,6 +258,10 @@ fn rmain() -> Result<(), Error> {
let mut flag_builder = settings::builder();
let mut features: Features = Default::default();
// There are two possible traps for division, and this way
// we get the proper one if code traps.
flag_builder.enable("avoid_div_traps")?;
// Enable/disable producing of debug info.
let debug_info = args.flag_g;

View File

@@ -128,6 +128,10 @@ fn main() {
let mut flag_builder = settings::builder();
let mut features: Features = Default::default();
// There are two possible traps for division, and this way
// we get the proper one if code traps.
flag_builder.enable("avoid_div_traps").unwrap();
// Enable verifier passes in debug mode.
if cfg!(debug_assertions) {
flag_builder.enable("enable_verifier").unwrap();