Skip to content

Commit 5dad33a

Browse files
committed
restructure tests
1 parent 404df00 commit 5dad33a

5 files changed

+3
-105
lines changed

tests/fail-dep/concurrency/libc_pthread_mutex_move.lock.stderr

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ignore-target-windows: No pthreads on Windows
2-
//@revisions: lock trylock unlock_register unlock_detect init
3-
//@[unlock_register]only-target-linux: recursive initializers are non-standard.
2+
//@revisions: static_initializer init
43

54
fn main() {
65
check();
@@ -17,54 +16,13 @@ fn check() {
1716
}
1817
}
1918

20-
#[cfg(lock)]
19+
#[cfg(static_initializer)]
2120
fn check() {
2221
unsafe {
2322
let mut m: libc::pthread_mutex_t = libc::PTHREAD_MUTEX_INITIALIZER;
2423
libc::pthread_mutex_lock(&mut m as *mut _);
2524

2625
let mut m2 = m;
27-
libc::pthread_mutex_lock(&mut m2 as *mut _); //~[lock] ERROR: pthread_mutex_t can't be moved after first use
28-
}
29-
}
30-
31-
#[cfg(trylock)]
32-
fn check() {
33-
unsafe {
34-
let mut m: libc::pthread_mutex_t = libc::PTHREAD_MUTEX_INITIALIZER;
35-
libc::pthread_mutex_trylock(&mut m as *mut _);
36-
37-
let mut m2 = m;
38-
libc::pthread_mutex_trylock(&mut m2 as *mut _); //~[trylock] ERROR: pthread_mutex_t can't be moved after first use
39-
}
40-
}
41-
42-
#[cfg(unlock_register)]
43-
fn check() {
44-
unsafe {
45-
let mut m: libc::pthread_mutex_t = libc::PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
46-
libc::pthread_mutex_unlock(&mut m as *mut _);
47-
48-
let mut m2 = m;
49-
libc::pthread_mutex_unlock(&mut m2 as *mut _); //~[unlock_register] ERROR: pthread_mutex_t can't be moved after first use
50-
}
51-
}
52-
53-
#[cfg(unlock_detect)]
54-
fn check() {
55-
unsafe {
56-
let mut mutexattr: libc::pthread_mutexattr_t = std::mem::zeroed();
57-
assert_eq!(
58-
libc::pthread_mutexattr_settype(
59-
&mut mutexattr as *mut _,
60-
libc::PTHREAD_MUTEX_RECURSIVE
61-
),
62-
0,
63-
);
64-
let mut m: libc::pthread_mutex_t = std::mem::zeroed();
65-
assert_eq!(libc::pthread_mutex_init(&mut m as *mut _, &mutexattr as *const _), 0);
66-
67-
let mut m2 = m;
68-
libc::pthread_mutex_unlock(&mut m2 as *mut _); //~[unlock_detect] ERROR: pthread_mutex_t can't be moved after first use
26+
libc::pthread_mutex_unlock(&mut m2 as *mut _); //~[static_initializer] ERROR: pthread_mutex_t can't be moved after first use
6927
}
7028
}

tests/fail-dep/concurrency/libc_pthread_mutex_move.trylock.stderr

-20
This file was deleted.

tests/fail-dep/concurrency/libc_pthread_mutex_move.unlock_register.stderr

-20
This file was deleted.

0 commit comments

Comments
 (0)