diff options
Diffstat (limited to 'tests/ui/env-null-vars.rs')
-rw-r--r-- | tests/ui/env-null-vars.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/env-null-vars.rs b/tests/ui/env-null-vars.rs new file mode 100644 index 000000000..10582a8a5 --- /dev/null +++ b/tests/ui/env-null-vars.rs @@ -0,0 +1,23 @@ +// run-pass + +#![allow(unused_imports)] + +// ignore-windows +// ignore-wasm32-bare no libc to test ffi with + +// issue-53200 + +#![feature(rustc_private)] +extern crate libc; + +use std::env; + +// FIXME: more platforms? +#[cfg(target_os = "linux")] +fn main() { + unsafe { libc::clearenv(); } + assert_eq!(env::vars().count(), 0); +} + +#[cfg(not(target_os = "linux"))] +fn main() {} |