Skip to content

Commit 6985431

Browse files
committed
make libc-misc pass under FreeBSD
1 parent 7338c55 commit 6985431

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/tools/miri/ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ case $HOST_TARGET in
108108
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
109109
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
110110
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
111-
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthreads-threadname libc-getentropy libc-getrandom libc-reallocarray atomic env/var
111+
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthreads-threadname libc-getentropy libc-getrandom libc-reallocarray libc-misc atomic env/var
112112
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
113113
MIRI_TEST_TARGET=wasm32-wasi run_tests_minimal no_std integer strings wasm
114114
MIRI_TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std integer strings wasm

src/tools/miri/tests/pass-dep/shims/libc-misc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ fn test_thread_local_errno() {
172172
}
173173

174174
/// Tests whether clock support exists at all
175+
#[cfg(not(target_os = "freebsd"))]
175176
fn test_clocks() {
176177
let mut tp = std::mem::MaybeUninit::<libc::timespec>::uninit();
177178
let is_error = unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, tp.as_mut_ptr()) };
@@ -237,6 +238,7 @@ fn test_isatty() {
237238
}
238239
}
239240

241+
#[cfg(not(target_os = "freebsd"))]
240242
fn test_posix_mkstemp() {
241243
use std::ffi::CString;
242244
use std::ffi::OsStr;
@@ -390,6 +392,8 @@ fn test_dlsym() {
390392

391393
fn main() {
392394
test_posix_gettimeofday();
395+
396+
#[cfg(not(target_os = "freebsd"))] // FIXME we should support this on FreeBSD as well
393397
test_posix_mkstemp();
394398

395399
test_posix_realpath_alloc();
@@ -399,7 +403,10 @@ fn main() {
399403
test_thread_local_errno();
400404

401405
test_isatty();
406+
407+
#[cfg(not(target_os = "freebsd"))] // FIXME we should support this on FreeBSD as well
402408
test_clocks();
409+
403410
test_dlsym();
404411

405412
test_memcpy();

0 commit comments

Comments
 (0)