Fixed Clang codegen and improved API for trampolines, added extra test