diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test index ce4e31970c1c8b676edc3d5efb2b65ba18b0450b..c5a3741b0b37c2a44693e4ad3ee05a4b25bc6619 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test @@ -11715,6 +11715,38 @@ head [,1] [1,] "f" +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testCbind# +#v <- 1:3; attr(v, 'a') <- 'a'; attr(v, 'a1') <- 'a1'; cbind(v); cbind(v, v) + v +[1,] 1 +[2,] 2 +[3,] 3 + v v +[1,] 1 1 +[2,] 2 2 +[3,] 3 3 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testCbind# +#v <- 1:3; v1<-1:3; attr(v, 'a') <- 'a'; attr(v1, 'a1') <- 'a1'; cbind(v, v1) + v v1 +[1,] 1 1 +[2,] 2 2 +[3,] 3 3 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testCbind# +#v <- 1; attr(v, 'a') <- 'a'; attr(v, 'a1') <- 'a1'; cbind(v); cbind(v, v) + v +[1,] 1 + v v +[1,] 1 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testCbind# +#v <- 1; attr(v, 'a') <- 'a'; cbind(v); cbind(v, v) + v +[1,] 1 + v v +[1,] 1 1 + ##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testCbind# #x <- matrix(1:20, 10, 2); dimnames(x) <- list(1:10, c('a','b')); cbind(1, x[,-1,drop=FALSE]); b @@ -11912,6 +11944,95 @@ c 2 a c 1 7 42 +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; cbind.foo <- function(...) 'foo'; cbind(v) } + v +[1,] 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; assign('cbind.foo', function(x) {'foo'}, envir=.__S3MethodsTable__.); cbind(v) ; rm('cbind.foo', envir=.__S3MethodsTable__.)} + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind(v) } + v +[1,] 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch#Ignored.WrongCaller# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function() 'foo'; cbind(v) } +Error in cbind(deparse.level, ...) : unused argument (1) + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(...) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(...) 'foo'; v2 <- 1; class(v2) <- 'foo'; cbind(v2) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(deparse.level, ...) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(deparse.level, x) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(deparse.level, x1, x2) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(x) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(x0, deparse.level, x1, x2) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- function(x0, x1, x2) 'foo'; cbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch#Ignored.ReferenceError# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- length; cbind(v) } + + *** caught segfault *** +address 0x7fbc0000007d, cause 'memory not mapped' + +Traceback: + 1: cbind(deparse.level, ...) + 2: cbind(v) +An irrecoverable exception occurred. R is aborting now ... + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch#Ignored.WrongCaller# +#{ v <- 1; class(v) <- 'foo'; cbind.foo <- rawToBits; cbind(v) } +Error in cbind(deparse.level, ...) : argument 'x' must be a raw vector + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); cbind.foo1 <- function(...) 'foo1'; cbind(v) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); cbind.foo1 <- function(...) 'foo1'; cbind.foo2 <- function(...) 'foo2'; cbind(v) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); cbind.foo2 <- function(...) 'foo2'; cbind(v) } +[1] "foo2" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; cbind.foo1 <- function(...) 'foo1'; v2 <- 2; class(v2) <- 'foo2'; cbind(v1, v2) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; cbind.foo1 <- function(...) 'foo1'; v2 <- 2; class(v2) <- 'foo2'; cbind.foo2 <- function(...) 'foo2'; cbind(v1, v2) } + v1 v2 +[1,] 1 2 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; v2 <- 2; class(v2) <- 'foo2'; cbind.foo2 <- function(...) 'foo2'; cbind(v1, v2) } +[1] "foo2" + ##com.oracle.truffle.r.test.builtins.TestBuiltin_cbind.testcbind1# #argv <- list(748L, c(5.08759633523238, 4.0943445622221, 5.66642668811243, 3.43398720448515), c(1L, 1L, 1L, 1L), 1L, c(FALSE, TRUE, TRUE, TRUE), c(0, 1, 0, 1), c(0, 1, 1, 1), c(0, 1, 0, 1), c(FALSE, FALSE, TRUE, FALSE), c(FALSE, FALSE, FALSE, TRUE));do.call('cbind', argv) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] @@ -41970,6 +42091,96 @@ Error in rawToBits(stdout()) : argument 'x' must be a raw vector #argv <- structure(list(x = as.raw(c(115, 116, 114, 105, 110, 103))), .Names = 'x');do.call('rawToChar', argv) [1] "string" +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; assign('rbind.foo', function(x) {'foo'}, envir=.__S3MethodsTable__.); rbind(v) ; rm('rbind.foo', envir=.__S3MethodsTable__.)} + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind(v) } + [,1] +v 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch#Ignored.WrongCaller# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function() 'foo'; rbind(v) } +Error in rbind(deparse.level, ...) : unused argument (1) + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(...) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(...) 'foo'; v2 <- 1; class(v2) <- 'foo'; rbind(v2) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(deparse.level, ...) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(deparse.level, x) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(deparse.level, x1, x2) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(x) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(x0, deparse.level, x1, x2) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- function(x0, x1, x2) 'foo'; rbind(v) } +[1] "foo" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch#Ignored.ReferenceError# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- length; rbind(v) } + + *** caught segfault *** +address 0x7fb70000007d, cause 'memory not mapped' + +Traceback: + 1: rbind(deparse.level, ...) + 2: rbind(v) +An irrecoverable exception occurred. R is aborting now ... + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch#Ignored.WrongCaller# +#{ v <- 1; class(v) <- 'foo'; rbind.foo <- rawToBits; rbind(v) } +Error in rbind(deparse.level, ...) : argument 'x' must be a raw vector + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); rbind.foo1 <- function(...) 'foo1'; rbind(v) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); rbind.foo1 <- function(...) 'foo1'; rbind.foo2 <- function(...) 'foo2'; rbind(v) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; class(v) <- c('foo1', 'foo2'); rbind.foo2 <- function(...) 'foo2'; rbind(v) } +[1] "foo2" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v <- 1; rbind.foo <- function(...) 'foo'; rbind(v) } + [,1] +v 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; rbind.foo1 <- function(...) 'foo1'; v2 <- 2; class(v2) <- 'foo2'; rbind(v1, v2) } +[1] "foo1" + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; rbind.foo1 <- function(...) 'foo1'; v2 <- 2; class(v2) <- 'foo2'; rbind.foo2 <- function(...) 'foo2'; rbind(v1, v2) } + [,1] +v1 1 +v2 2 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testGenericDispatch# +#{ v1 <- 1; class(v1) <- 'foo1'; v2 <- 2; class(v2) <- 'foo2'; rbind.foo2 <- function(...) 'foo2'; rbind(v1, v2) } +[1] "foo2" + ##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# #rbind(55, character(0)) [,1] @@ -41990,6 +42201,36 @@ a "55" [,1] [1,] "f" +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# +#v <- 1:3; attr(v, 'a') <- 'a'; attr(v, 'a1') <- 'a1'; rbind(v); rbind(v, v) + [,1] [,2] [,3] +v 1 2 3 + [,1] [,2] [,3] +v 1 2 3 +v 1 2 3 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# +#v <- 1:3; v1<-1:3; attr(v, 'a') <- 'a'; attr(v1, 'a1') <- 'a1'; rbind(v, v1) + [,1] [,2] [,3] +v 1 2 3 +v1 1 2 3 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# +#v <- 1; attr(v, 'a') <- 'a'; attr(v, 'a1') <- 'a1'; rbind(v); rbind(v, v) + [,1] +v 1 + [,1] +v 1 +v 1 + +##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# +#v <- 1; attr(v, 'a') <- 'a'; rbind(v); rbind(v, v) + [,1] +v 1 + [,1] +v 1 +v 1 + ##com.oracle.truffle.r.test.builtins.TestBuiltin_rbind.testRbind# #{ info <- c("print", "AES", "print.AES") ; ns <- integer(0) ; rbind(info, ns) } [,1] [,2] [,3]