1 // ignore-windows: No libc on Windows
2 // compile-flags: -Zmiri-disable-isolation
4 #![feature(rustc_private)]
9 test_file_open_missing_needed_mode();
12 fn test_file_open_missing_needed_mode() {
13 let name = b"missing_arg.txt\0";
14 let name_ptr = name.as_ptr().cast::<libc::c_char>();
15 let _fd = unsafe { libc::open(name_ptr, libc::O_CREAT) }; //~ ERROR Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3