1 ; RUN: llc < %s -mtriple=i386-pc-linux -mcpu=corei7 -relocation-model=static | FileCheck --check-prefix=X86 %s
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux -mcpu=corei7 | FileCheck --check-prefix=X64 %s
4 @buf = internal global [5 x i8*] zeroinitializer
6 declare i8* @llvm.frameaddress(i32) nounwind readnone
8 declare i8* @llvm.stacksave() nounwind
10 declare i32 @llvm.eh.sjlj.setjmp(i8*) nounwind
12 declare void @llvm.eh.sjlj.longjmp(i8*) nounwind
14 define i32 @sj0() nounwind {
15 %fp = tail call i8* @llvm.frameaddress(i32 0)
16 store i8* %fp, i8** getelementptr inbounds ([5 x i8*]* @buf, i64 0, i64 0), align 16
17 %sp = tail call i8* @llvm.stacksave()
18 store i8* %sp, i8** getelementptr inbounds ([5 x i8*]* @buf, i64 0, i64 2), align 16
19 %r = tail call i32 @llvm.eh.sjlj.setjmp(i8* bitcast ([5 x i8*]* @buf to i8*))
23 ; x86: movl ${{.*LBB.*}}, buf+4
24 ; X86: movl %esp, buf+8
27 ; x64: movq %rbp, buf(%rip)
28 ; x64: movq ${{.*LBB.*}}, buf+8(%rip)
29 ; X64: movq %rsp, buf+16(%rip)
33 define void @lj0() nounwind {
34 tail call void @llvm.eh.sjlj.longjmp(i8* bitcast ([5 x i8*]* @buf to i8*))
38 ; X86: movl buf+4, %[[REG32:.*]]
39 ; X86: movl buf+8, %esp
40 ; X86: jmpl *%[[REG32]]
42 ; X64: movq buf(%rip), %rbp
43 ; X64: movq buf+8(%rip), %[[REG64:.*]]
44 ; X64: movq buf+16(%rip), %rsp
45 ; X64: jmpq *%[[REG64]]