Fix up a few more tests
This commit is contained in:
parent
44d679b902
commit
8d3bc55904
@ -1,10 +1,7 @@
|
|||||||
#![crate_type = "staticlib"]
|
#![crate_type = "staticlib"]
|
||||||
#![feature(c_variadic)]
|
#![feature(c_variadic)]
|
||||||
#![feature(rustc_private)]
|
|
||||||
|
|
||||||
extern crate libc;
|
use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
|
||||||
|
|
||||||
use libc::{c_char, c_double, c_int, c_long, c_longlong};
|
|
||||||
use std::ffi::VaList;
|
use std::ffi::VaList;
|
||||||
use std::ffi::{CString, CStr};
|
use std::ffi::{CString, CStr};
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#![feature(rustc_private)]
|
use std::ffi::c_int;
|
||||||
|
|
||||||
extern crate libc;
|
|
||||||
|
|
||||||
#[link(name = "foo", kind = "static")]
|
#[link(name = "foo", kind = "static")]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn should_return_one() -> libc::c_int;
|
fn should_return_one() -> c_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,21 +1,15 @@
|
|||||||
|
// Ensure that env::vars() does not panic if environ is null.
|
||||||
|
// Regression test for rust-lang/rust#53200
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
#![allow(unused_imports)]
|
|
||||||
|
|
||||||
//@ ignore-windows
|
|
||||||
|
|
||||||
// issue-53200
|
|
||||||
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
extern crate libc;
|
|
||||||
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
// FIXME: more platforms?
|
// FIXME: more platforms?
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn main() {
|
fn main() {
|
||||||
|
extern crate libc;
|
||||||
unsafe { libc::clearenv(); }
|
unsafe { libc::clearenv(); }
|
||||||
assert_eq!(env::vars().count(), 0);
|
assert_eq!(std::env::vars().count(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
|
@ -8,21 +8,16 @@
|
|||||||
//@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
|
//@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
|
||||||
//@ ignore-nto no stack overflow handler used (no alternate stack available)
|
//@ ignore-nto no stack overflow handler used (no alternate stack available)
|
||||||
|
|
||||||
#![feature(core_intrinsics)]
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use std::hint::black_box;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
// Inlining to avoid llvm turning the recursive functions into tail calls,
|
|
||||||
// which doesn't consume stack.
|
|
||||||
#[inline(always)]
|
|
||||||
pub fn black_box<T>(dummy: T) { std::intrinsics::black_box(dummy); }
|
|
||||||
|
|
||||||
fn silent_recurse() {
|
fn silent_recurse() {
|
||||||
let buf = [0u8; 1000];
|
let buf = [0u8; 1000];
|
||||||
black_box(buf);
|
black_box(buf);
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
//@ error-pattern: Location is heap block of size 4
|
//@ error-pattern: Location is heap block of size 4
|
||||||
//@ error-pattern: allocated by main thread
|
//@ error-pattern: allocated by main thread
|
||||||
|
|
||||||
#![feature(raw_ref_op)]
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user