forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#63207 - petrochenkov:outest2, r=Mark-Simulacrum
Unconfigure compiler unit test files during normal build I haven't touched libstd though, it had a lot of tests and I'm not sure the people maintaining it want this. Closes rust-lang#61097 r? @Mark-Simulacrum
- Loading branch information
Showing
118 changed files
with
6,020 additions
and
6,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use super::*; | ||
|
||
extern crate test; | ||
use test::Bencher; | ||
use crate::boxed::Box; | ||
|
||
#[test] | ||
fn allocate_zeroed() { | ||
unsafe { | ||
let layout = Layout::from_size_align(1024, 1).unwrap(); | ||
let ptr = Global.alloc_zeroed(layout.clone()) | ||
.unwrap_or_else(|_| handle_alloc_error(layout)); | ||
|
||
let mut i = ptr.cast::<u8>().as_ptr(); | ||
let end = i.add(layout.size()); | ||
while i < end { | ||
assert_eq!(*i, 0); | ||
i = i.offset(1); | ||
} | ||
Global.dealloc(ptr, layout); | ||
} | ||
} | ||
|
||
#[bench] | ||
#[cfg(not(miri))] // Miri does not support benchmarks | ||
fn alloc_owned_small(b: &mut Bencher) { | ||
b.iter(|| { | ||
let _: Box<_> = box 10; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.