tests/constantFolding.R

library(RLLVMCompile)

f =
function(x)
{
  x * 1
}

fc = compileFunction(f, DoubleType, DoubleType)
showModule(fc)

g =
function(x)
{
  x + 0
}

fc = compileFunction(g, DoubleType, DoubleType)
showModule(fc)


g =
function(x)
{
  x / 1
}

fc = compileFunction(g, DoubleType, DoubleType)
showModule(fc)

g =
function(x)
{
  x - 0
}

fc = compileFunction(g, DoubleType, DoubleType)
showModule(fc)



h =
function(x)
{
  1 + 2 - 3
}

hc = compileFunction(h, DoubleType, DoubleType)
showModule(hc)
duncantl/RLLVMCompile documentation built on May 15, 2019, 5:31 p.m.