Skip to content

organize shim tests into shims folder, and various test suite tweaks #2492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_create_main_terminate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

// Check that we terminate the program when the main thread terminates.

#![feature(rustc_private)]

use std::{mem, ptr};

extern "C" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_join_detached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// Joining a detached thread is undefined behavior.

#![feature(rustc_private)]

use std::{mem, ptr};

extern "C" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_join_joined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// Joining an already joined thread is undefined behavior.

#![feature(rustc_private)]

use std::{mem, ptr};

extern "C" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_join_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// Joining the main thread is undefined behavior.

#![feature(rustc_private)]

use std::{ptr, thread};

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_join_multiple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// Joining the same thread from multiple threads is undefined behavior.

#![feature(rustc_private)]

use std::thread;
use std::{mem, ptr};

Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/libc_pthread_join_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// Joining itself is undefined behavior.

#![feature(rustc_private)]

use std::{ptr, thread};

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/too_few_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

//! The thread function must have exactly one argument.

#![feature(rustc_private)]

use std::{mem, ptr};

extern "C" fn thread_start() -> *mut libc::c_void {
Expand Down
2 changes: 0 additions & 2 deletions tests/fail/concurrency/too_many_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

//! The thread function must have exactly one argument.

#![feature(rustc_private)]

use std::{mem, ptr};

extern "C" fn thread_start(_null: *mut libc::c_void, _x: i32) -> *mut libc::c_void {
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/concurrency/unwind_top_of_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//! Unwinding past the top frame of a stack is Undefined Behavior.

#![feature(rustc_private, c_unwind)]
#![feature(c_unwind)]

use std::{mem, ptr};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

// FIXME: standard handles cannot be closed (https://github.com/rust-lang/rust/issues/40032)

#![feature(rustc_private)]

fn main() {
unsafe {
libc::close(1); //~ ERROR: cannot close stdout
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() -> std::io::Result<()> {
let mut bytes = [0u8; 512];
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ignore-target-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation

#![feature(rustc_private)]

fn main() {
test_mkstemp_immutable_arg();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@compile-flags: -Zmiri-disable-isolation
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() -> std::io::Result<()> {
let mut bytes = [0u8; 512];
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ignore-target-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation

#![feature(rustc_private)]

fn main() {
test_file_open_missing_needed_mode();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() -> std::io::Result<()> {
let bytes = b"hello";
unsafe {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

/// Test that destroying a pthread_cond twice fails, even without a check for number validity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

/// Test that destroying a pthread_condattr twice fails, even without a check for number validity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//
// Check that if we pass NULL attribute, then we get the default mutex type.

#![feature(rustc_private)]

fn main() {
unsafe {
let mut mutex: libc::pthread_mutex_t = std::mem::zeroed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//
// Check that if we do not set the mutex type, it is the default.

#![feature(rustc_private)]

fn main() {
unsafe {
let mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
unsafe {
let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

/// Test that destroying a pthread_mutex twice fails, even without a check for number validity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
unsafe {
let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
unsafe {
let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

/// Test that destroying a pthread_mutexattr twice fails, even without a check for number validity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

/// Test that destroying a pthread_rwlock twice fails, even without a check for number validity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::cell::UnsafeCell;
use std::sync::Arc;
use std::thread;
Expand Down
1 change: 0 additions & 1 deletion tests/fail/unsupported_signal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! `signal()` is special on Linux and macOS that it's only supported within libstd.
//! The implementation is not complete enough to permit user code to call it.
//@ignore-target-windows: No libc on Windows
#![feature(rustc_private)]

fn main() {
unsafe {
Expand Down
1 change: 0 additions & 1 deletion tests/panic/unsupported_syscall.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ignore-target-windows: No libc on Windows
//@ignore-target-apple: `syscall` is not supported on macOS
//@compile-flags: -Zmiri-panic-on-unsupported
#![feature(rustc_private)]

fn main() {
unsafe {
Expand Down
2 changes: 0 additions & 2 deletions tests/pass/calloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use core::slice;

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions tests/pass/concurrency/libc_pthread_cond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//@ignore-target-apple: pthread_condattr_setclock is not supported on MacOS.
//@compile-flags: -Zmiri-disable-isolation

#![feature(rustc_private)]

/// Test that conditional variable timeouts are working properly with both
/// monotonic and system clocks.
use std::mem::MaybeUninit;
Expand Down
2 changes: 0 additions & 2 deletions tests/pass/concurrency/linux-futex.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@only-target-linux
//@compile-flags: -Zmiri-disable-isolation

#![feature(rustc_private)]

use std::mem::MaybeUninit;
use std::ptr;
use std::sync::atomic::AtomicI32;
Expand Down
2 changes: 0 additions & 2 deletions tests/pass/concurrency/tls_pthread_drop_order.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use std::mem;
use std::ptr;

Expand Down
3 changes: 0 additions & 3 deletions tests/pass/foreign-fn-linkname.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//ignore-windows: Uses POSIX APIs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oli-obk this seems to have been missed in the //@ transition. Also turns out the libc crate has enough stuff on Windows to actually make this test work. Still makes me wonder if anything else was missed... (I did some grepping and could not find anything).

#![feature(rustc_private)]

use std::ffi::CString;

mod mlibc {
Expand Down
2 changes: 0 additions & 2 deletions tests/pass/malloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ignore-target-windows: No libc on Windows

#![feature(rustc_private)]

use core::{ptr, slice};

fn main() {
Expand Down
4 changes: 0 additions & 4 deletions tests/pass/regions-mock-trans.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//ignore-windows: Uses POSIX APIs

#![feature(rustc_private)]

use std::mem;

struct Arena(());
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion tests/pass/fs.rs → tests/pass/shims/fs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ignore-target-windows: File handling is not implemented yet
//@compile-flags: -Zmiri-disable-isolation

#![feature(rustc_private)]
#![feature(io_error_more)]
#![feature(io_error_uncategorized)]

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//@compile-flags: -Zmiri-isolation-error=warn-nobacktrace
//@normalize-stderr-test: "(stat(x)?)" -> "$$STAT"

#![feature(rustc_private)]

use std::ffi::CString;
use std::fs::{self, File};
use std::io::{Error, ErrorKind};
Expand Down
Loading