2022-07-17 21:54:10 -04:00
|
|
|
//@ignore-target-windows: No libc on Windows
|
2021-12-06 21:15:02 +00:00
|
|
|
#![feature(rustc_private)]
|
|
|
|
|
|
|
|
/// Test that destroying a pthread_rwlock twice fails, even without a check for number validity
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
let mut lock = libc::PTHREAD_RWLOCK_INITIALIZER;
|
|
|
|
|
|
|
|
libc::pthread_rwlock_destroy(&mut lock);
|
|
|
|
|
|
|
|
libc::pthread_rwlock_destroy(&mut lock);
|
2022-07-11 11:44:55 +00:00
|
|
|
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
|
2021-12-06 21:15:02 +00:00
|
|
|
}
|
|
|
|
}
|