Skip to content

Commit

Permalink
Fix up a few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Apr 18, 2024
1 parent 84dae2e commit cbbeb98
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
5 changes: 1 addition & 4 deletions tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#![crate_type = "staticlib"]
#![feature(c_variadic)]
#![feature(rustc_private)]

extern crate libc;

use libc::{c_char, c_double, c_int, c_long, c_longlong};
use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
use std::ffi::VaList;
use std::ffi::{CString, CStr};

Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/link-path-order/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#![feature(rustc_private)]

extern crate libc;
use std::ffi::c_int;

#[link(name = "foo", kind = "static")]
extern "C" {
fn should_return_one() -> libc::c_int;
fn should_return_one() -> c_int;
}

fn main() {
Expand Down
14 changes: 4 additions & 10 deletions tests/ui/env-null-vars.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
// Ensure that env::vars() does not panic if environ is null.
// Regression test for rust-lang/rust#53200
//@ run-pass

#![allow(unused_imports)]

//@ ignore-windows

// issue-53200

#![feature(rustc_private)]
extern crate libc;

use std::env;

// FIXME: more platforms?
#[cfg(target_os = "linux")]
fn main() {
extern crate libc;
unsafe { libc::clearenv(); }
assert_eq!(env::vars().count(), 0);
assert_eq!(std::env::vars().count(), 0);
}

#[cfg(not(target_os = "linux"))]
Expand Down
7 changes: 1 addition & 6 deletions tests/ui/runtime/out-of-stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@
//@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
//@ ignore-nto no stack overflow handler used (no alternate stack available)

#![feature(core_intrinsics)]
#![feature(rustc_private)]

#[cfg(unix)]
extern crate libc;

use std::env;
use std::hint::black_box;
use std::process::Command;
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() {
let buf = [0u8; 1000];
black_box(buf);
Expand Down
1 change: 0 additions & 1 deletion tests/ui/sanitizer/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
//@ error-pattern: Location is heap block of size 4
//@ error-pattern: allocated by main thread

#![feature(raw_ref_op)]
#![feature(rustc_private)]
extern crate libc;

Expand Down

0 comments on commit cbbeb98

Please sign in to comment.