summaryrefslogtreecommitdiffstats
path: root/eval/src/tests
diff options
context:
space:
mode:
authorHaavard <havardpe@yahoo-inc.com>2017-03-28 09:02:02 +0000
committerHaavard <havardpe@yahoo-inc.com>2017-03-28 14:33:11 +0000
commit0ffedaadf4be9183c80eac834151bd5a01bcee16 (patch)
tree4f3bc59aae388619479b3c62e93e01bf2a21f19a /eval/src/tests
parentdaa0a43e5e8629b63be12b5205411d926d1bab06 (diff)
change code to work with LLVM 3.9.1
Diffstat (limited to 'eval/src/tests')
-rw-r--r--eval/src/tests/eval/compiled_function/compiled_function_test.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/eval/src/tests/eval/compiled_function/compiled_function_test.cpp b/eval/src/tests/eval/compiled_function/compiled_function_test.cpp
index 6a1b1f587e3..0eb5b409a3e 100644
--- a/eval/src/tests/eval/compiled_function/compiled_function_test.cpp
+++ b/eval/src/tests/eval/compiled_function/compiled_function_test.cpp
@@ -179,12 +179,15 @@ TEST("require that expressions with constant sub-expressions evaluate correctly"
}
TEST("dump ir code to verify lazy casting") {
- CompiledFunction cf(Function::parse({"a", "b"}, "12==2+if(a==3&&a<10||b,10,5)"), PassParams::SEPARATE);
- auto fun = cf.get_function<2>();
+ Function function = Function::parse({"a", "b"}, "12==2+if(a==3&&a<10||b,10,5)");
+ LLVMWrapper wrapper;
+ size_t id = wrapper.make_function(function.num_params(), PassParams::SEPARATE, function.root(), {});
+ wrapper.compile(true); // dump module before compiling it
+ using fun_type = double (*)(double, double);
+ fun_type fun = (fun_type) wrapper.get_function_address(id);
EXPECT_EQUAL(0.0, fun(0.0, 0.0));
EXPECT_EQUAL(1.0, fun(0.0, 1.0));
EXPECT_EQUAL(1.0, fun(3.0, 0.0));
- cf.dump();
}
TEST_MT("require that multithreaded compilation works", 64) {