test HashMap creation in libstd-MIR, and make it work again

This commit is contained in:
Ralf Jung
2017-06-21 23:09:34 -07:00
parent 894306e47d
commit 7b2b0dd56c
2 changed files with 2 additions and 5 deletions
+2 -1
View File
@@ -424,9 +424,10 @@ pub(super) fn call_intrinsic(
let ty_align = self.type_align(ty)?;
let val_byte = self.value_to_primval(arg_vals[1], u8)?.to_u128()? as u8;
let size = self.type_size(ty)?.expect("write_bytes() type must be sized");
let ptr = arg_vals[0].read_ptr(&self.memory)?.to_ptr()?;
let ptr = arg_vals[0].read_ptr(&self.memory)?;
let count = self.value_to_primval(arg_vals[2], usize)?.to_u64()?;
if count > 0 {
let ptr = ptr.to_ptr()?;
self.memory.check_align(ptr, ty_align, size * count)?;
self.memory.write_repeat(ptr, val_byte, size * count)?;
}
@@ -1,10 +1,6 @@
use std::collections::{self, HashMap};
use std::hash::BuildHasherDefault;
// This disables the test completely:
// ignore-stage1
// TODO: The tests actually passes against rustc and miri with MIR-libstd, but right now, we cannot express that in the test flags
fn main() {
let map : HashMap<String, i32, BuildHasherDefault<collections::hash_map::DefaultHasher>> = Default::default();
assert_eq!(map.values().fold(0, |x, y| x+y), 0);