Add libffi to test build
Fix testcase for older LLVM releases