Skip to content

Commit

Permalink
fix oom2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 25, 2017
1 parent a8980fd commit 6e86503
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/compile-fail/oom2.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Validation forces more allocation; disable it.
// compile-flags: -Zmir-emit-validate=0
#![feature(box_syntax, custom_attribute, attr_literals)]
#![miri(memory_size=2048)]
#![miri(memory_size=1024)]

// On 64bit platforms, the allocator needs 32 bytes allocated to pass a return value, so that's the error we see.
// On 32bit platforms, it's just 16 bytes.
// error-pattern: tried to allocate

fn main() {
loop {
::std::mem::forget(box 42); //~ ERROR tried to allocate 4 more bytes
::std::mem::forget(box 42);
}
}

0 comments on commit 6e86503

Please sign in to comment.