1 // needs-sanitizer-support
2 // needs-sanitizer-memory
4 // compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
7 // error-pattern: MemorySanitizer: use-of-uninitialized-value
8 // error-pattern: Uninitialized value was created by an allocation
9 // error-pattern: in the stack frame
11 // This test case intentionally limits the usage of the std,
12 // since it will be linked with an uninstrumented version of it.
14 #![feature(core_intrinsics)]
16 #![feature(bench_black_box)]
18 use std::hint::black_box;
19 use std::mem::MaybeUninit;
23 fn random() -> [isize; 32] {
24 let r = unsafe { MaybeUninit::uninit().assume_init() };
25 // Avoid optimizing everything out.
31 fn xor(a: &[isize]) -> isize {
40 fn main(_: isize, _: *const *const u8) -> isize {