diff --git a/src/test/run-pass/invoke-external-native.rs b/src/test/run-pass/invoke-external-native.rs new file mode 100644 index 00000000000..6234685419b --- /dev/null +++ b/src/test/run-pass/invoke-external-native.rs @@ -0,0 +1,11 @@ +// xfail-test + +import std::sys; + +// The purpose of this test is to check that we can +// successfully (and safely) invoke external, c-stack-cdecl +// functions from outside the crate. + +fn main() { + let foo = sys::rustrt::last_os_error(); +} \ No newline at end of file diff --git a/src/test/stdtest/sys.rs b/src/test/stdtest/sys.rs index 547adba7bf5..6f766e9ee6b 100644 --- a/src/test/stdtest/sys.rs +++ b/src/test/stdtest/sys.rs @@ -1,4 +1,6 @@ import std::sys; #[test] -fn last_os_error() unsafe { log sys::rustrt::last_os_error(); } +fn last_os_error() { + log sys::last_os_error(); +}