about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass-dep/getrandom.rs
blob: d359730e7f9715b7ddd9619cee27ce3755c353ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// mac-os `getrandom_01` does some pointer shenanigans
//@compile-flags: -Zmiri-permissive-provenance
//@revisions: isolation no_isolation
//@[no_isolation]compile-flags: -Zmiri-disable-isolation

/// Test direct calls of getrandom 0.1, 0.2 and 0.3.
fn main() {
    let mut data = vec![0; 16];

    // Old Solaris had a different return type for `getrandom`, and old versions of the getrandom crate
    // used that signature, which Miri is not happy about.
    #[cfg(not(target_os = "solaris"))]
    getrandom_01::getrandom(&mut data).unwrap();

    getrandom_02::getrandom(&mut data).unwrap();

    getrandom_03::fill(&mut data).unwrap();
}