Skip to content

Instantly share code, notes, and snippets.

@chfast
Created February 9, 2015 13:39
Show Gist options
  • Save chfast/933d622b37cf468f9c4d to your computer and use it in GitHub Desktop.
Save chfast/933d622b37cf468f9c4d to your computer and use it in GitHub Desktop.
define i32 @main() {
%buf = alloca i8, i32 24, align 16
%r = call i32 @llvm.eh.sjlj.setjmp(i8* %buf)
;%r = add i32 0, 1
%normal = icmp eq i32 %r, 0
br i1 %normal, label %Normal, label %Jump
Normal:
call void @llvm.eh.sjlj.longjmp(i8* %buf)
ret i32 2
Jump:
ret i32 0
}
declare i32 @llvm.eh.sjlj.setjmp(i8* %setjmp_buf) returns_twice nounwind
declare void @llvm.eh.sjlj.longjmp(i8* %setjmp_buf) noreturn nounwind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment