2021-12-05 07:54:25 -06:00
|
|
|
// ignore-windows: No libc on Windows
|
|
|
|
#![feature(rustc_private)]
|
|
|
|
|
|
|
|
/// Test that destroying a pthread_condattr twice fails, even without a check for number validity
|
|
|
|
extern crate libc;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
use core::mem::MaybeUninit;
|
|
|
|
let mut attr = MaybeUninit::<libc::pthread_condattr_t>::uninit();
|
|
|
|
|
|
|
|
libc::pthread_condattr_init(attr.as_mut_ptr());
|
|
|
|
|
|
|
|
libc::pthread_condattr_destroy(attr.as_mut_ptr());
|
|
|
|
|
|
|
|
libc::pthread_condattr_destroy(attr.as_mut_ptr());
|
2022-05-30 07:17:36 -05:00
|
|
|
//~^ ERROR Undefined Behavior: using uninitialized data, but this operation requires initialized memory
|
2021-12-05 07:54:25 -06:00
|
|
|
}
|
|
|
|
}
|