diff options
-rw-r--r-- | ll.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -765,8 +765,14 @@ main() } void* fp = engine->getPointerToFunction(f); - double (*cfunc)() = (double (*)())fp; - std::cout << cfunc(); + if (bodyT->ctype == Type::Int32Ty) + std::cout << ((int32_t (*)())fp)(); + else if (bodyT->ctype == Type::FloatTy) + std::cout << ((float (*)())fp)(); + else if (bodyT->ctype == Type::Int1Ty) + std::cout << ((bool (*)())fp)(); + else + std::cout << "?"; } else { Value* val = body->compile(cenv); |