File tree Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Expand file tree Collapse file tree 3 files changed +18
-17
lines changed Original file line number Diff line number Diff 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 libc- misc 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-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
Original file line number Diff line number Diff line change @@ -390,6 +390,19 @@ fn test_dlsym() {
390390 assert_eq ! ( errno, libc:: EBADF ) ;
391391}
392392
393+ #[ cfg( not( target_os = "macos" ) ) ]
394+ fn test_reallocarray ( ) {
395+ unsafe {
396+ let mut p = libc:: reallocarray ( std:: ptr:: null_mut ( ) , 4096 , 2 ) ;
397+ assert ! ( !p. is_null( ) ) ;
398+ libc:: free ( p) ;
399+ p = libc:: malloc ( 16 ) ;
400+ let r = libc:: reallocarray ( p, 2 , 32 ) ;
401+ assert ! ( !r. is_null( ) ) ;
402+ libc:: free ( r) ;
403+ }
404+ }
405+
393406fn main ( ) {
394407 test_posix_gettimeofday ( ) ;
395408
@@ -412,6 +425,10 @@ fn main() {
412425 test_memcpy ( ) ;
413426 test_strcpy ( ) ;
414427
428+ #[ cfg( not( target_os = "macos" ) ) ] // reallocarray does not exist on macOS
429+ test_reallocarray ( ) ;
430+
431+ // These are Linux-specific
415432 #[ cfg( target_os = "linux" ) ]
416433 {
417434 test_posix_fadvise ( ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments