1 ; RUN: llc < %s -march=sparc | FileCheck %s
2 ; RUN: llc < %s -march=sparc -mcpu=leon2 | FileCheck %s
3 ; RUN: llc < %s -march=sparc -mcpu=leon3 | FileCheck %s
4 ; RUN: llc < %s -march=sparc -mcpu=leon4 | FileCheck %s
6 %struct.__jmp_buf_tag = type { [64 x i64], i32, %struct.__sigset_t, [8 x i8] }
7 %struct.__sigset_t = type { [16 x i64] }
9 @env_sigill = internal global [1 x %struct.__jmp_buf_tag] zeroinitializer, align 16
11 define void @foo() #0 {
13 call void @llvm.eh.sjlj.longjmp(i8* bitcast ([1 x %struct.__jmp_buf_tag]* @env_sigill to i8*))
18 ; CHECK: ld [%i0], %fp
19 ; CHECK: ld [%i0+4], %i1
20 ; CHECK: ld [%i0+8], %sp
22 ; CHECK: ld [%i0+12], %i7
24 return: ; No predecessors!
28 declare void @llvm.eh.sjlj.longjmp(i8*) #1
30 define signext i32 @main() #0 {
32 %retval = alloca i32, align 4
33 store i32 0, i32* %retval
34 %0 = call i8* @llvm.frameaddress(i32 0)
35 store i8* %0, i8** bitcast ([1 x %struct.__jmp_buf_tag]* @env_sigill to i8**)
36 %1 = call i8* @llvm.stacksave()
37 store i8* %1, i8** getelementptr (i8*, i8** bitcast ([1 x %struct.__jmp_buf_tag]* @env_sigill to i8**), i32 2)
38 %2 = call i32 @llvm.eh.sjlj.setjmp(i8* bitcast ([1 x %struct.__jmp_buf_tag]* @env_sigill to i8*))
39 %tobool = icmp ne i32 %2, 0
40 br i1 %tobool, label %if.then, label %if.else
42 if.then: ; preds = %entry
43 store i32 1, i32* %retval
46 if.else: ; preds = %entry
50 if.end: ; preds = %if.else
51 store i32 0, i32* %retval
54 return: ; preds = %if.end, %if.then
55 %3 = load i32, i32* %retval
59 ; CHECK: st %fp, [%i0]
60 ; CHECK: sethi %hi(.LBB1_2), %i1
61 ; CHECK: or %i1, %lo(.LBB1_2), %i1
62 ; CHECK: st %i1, [%i0+4]
63 ; CHECK: st %sp, [%i0+8]
65 ; CHECK: st %i7, [%i0+12]
68 ; CHECK:.LBB1_1: ! %entry
77 ; CHECK:.LBB1_2: ! Block address taken
83 declare i8* @llvm.frameaddress(i32) #2
85 declare i8* @llvm.stacksave() #3
87 declare i32 @llvm.eh.sjlj.setjmp(i8*) #3
89 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
90 attributes #1 = { noreturn nounwind }
91 attributes #2 = { nounwind readnone }
92 attributes #3 = { nounwind }