11
2- # # Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois
2+ # # Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois
33# # Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
44# #
55# # This file is part of Rcpp.
@@ -24,6 +24,8 @@ Rcpp::sourceCpp("cpp/sugar.cpp")
2424# # There are some (documented, see https://blog.r-project.org/2020/11/02/will-r-work-on-apple-silicon/index.html)
2525# # issues with NA propagation on arm64 / macOS. We not (yet ?) do anything special so we just skip some tests
2626isArmMacOs <- Sys.info()[[" sysname" ]] == " Darwin" && Sys.info()[[" machine" ]] == " arm64"
27+ # # This also seems to hit arm64 on Linux
28+ isArmLinux <- Sys.info()[[" sysname" ]] == " Linux" && Sys.info()[[" machine" ]] == " arm64"
2729
2830# # Needed for a change in R 3.6.0 reducing a bias in very large samples
2931suppressWarnings(RNGversion(" 3.5.0" ))
@@ -66,15 +68,15 @@ expect_true( ! fx( 1:10 ) )
6668expect_true( fx( 6 : 10 ) )
6769expect_true( fx( 5 ) )
6870expect_true( ! fx( c(NA , 1 ) ) )
69- if (! isArmMacOs ) expect_true( is.na( fx( c(NA , 6 ) ) ) )
71+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(NA , 6 ) ) ) )
7072
7173
7274# test.sugar.all.one.equal <- function( ){
7375fx <- runit_all_one_equal
7476expect_true( ! fx( 1 ) )
7577expect_true( ! fx( 1 : 2 ) )
7678expect_true( fx( rep(5 ,4 ) ) )
77- if (! isArmMacOs ) expect_true( is.na( fx( c(5 ,NA ) ) ) )
79+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(5 ,NA ) ) ) )
7880expect_true(! fx( c(NA , 1 ) ) )
7981
8082
@@ -83,7 +85,7 @@ fx <- runit_all_not_equal_one
8385expect_true( fx( 1 ) )
8486expect_true( fx( 1 : 2 ) )
8587expect_true( ! fx( 5 ) )
86- if (! isArmMacOs ) expect_true( is.na( fx( c(NA , 1 ) ) ) )
88+ if (! isArmMacOs && ! isArmLinux ) expect_true( is.na( fx( c(NA , 1 ) ) ) )
8789expect_true( ! fx( c(NA , 5 ) ) )
8890
8991
@@ -1620,7 +1622,7 @@ expect_error(strimws(x[1], "invalid"), info = "strimws -- bad `which` argument")
16201622# # min/max
16211623# test.sugar.min.max <- function() {
16221624# # min(empty) gives NA for integer, Inf for numeric (#844)
1623- if (! isArmMacOs ) expect_true(is.na(intmin(integer(0 ))), " min(integer(0))" )
1625+ if (! isArmMacOs && ! isArmLinux ) expect_true(is.na(intmin(integer(0 ))), " min(integer(0))" )
16241626if (! isArmMacOs ) expect_equal(doublemin(numeric (0 )), Inf , info = " min(numeric(0))" )
16251627
16261628# # max(empty_ gives NA for integer, Inf for numeric (#844)
0 commit comments