ahatanak added a comment. I wasn't sure how to test traps inside ctor/dtor or global constructor, so I went ahead and committed the reviewed patch. I can add the tests later if I can find a way to emit traps for those functions. rL LLVM http://reviews.llvm.org/D10831