1 ; RUN: llc < %s -march=mipsel -mcpu=4ke | FileCheck %s -check-prefix=CHECK-EL
2 ; RUN: llc < %s -march=mips -mcpu=4ke | FileCheck %s -check-prefix=CHECK-EB
4 @g1 = global double 0.000000e+00, align 8
5 @_ZTId = external constant i8*
7 define void @_Z1fd(double %i2) {
9 ; CHECK-EL: addiu $sp, $sp
10 ; CHECK-EL: .cfi_def_cfa_offset
15 ; CHECK-EL: .cfi_offset 52, -8
16 ; CHECK-EL: .cfi_offset 53, -4
17 ; CHECK-EB: .cfi_offset 53, -8
18 ; CHECK-EB: .cfi_offset 52, -4
19 ; CHECK-EL: .cfi_offset 31, -12
20 ; CHECK-EL: .cfi_offset 17, -16
21 ; CHECK-EL: .cfi_offset 16, -20
22 ; CHECK-EL: .cprestore
24 %exception = tail call i8* @__cxa_allocate_exception(i32 8) nounwind
25 %0 = bitcast i8* %exception to double*
26 store double 3.200000e+00, double* %0, align 8, !tbaa !0
27 invoke void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTId to i8*), i8* null) noreturn
28 to label %unreachable unwind label %lpad
30 lpad: ; preds = %entry
35 %exn = tail call i8* @llvm.eh.exception() nounwind
36 %eh.selector = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* bitcast (i8** @_ZTId to i8*)) nounwind
37 %1 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTId to i8*)) nounwind
38 %2 = icmp eq i32 %eh.selector, %1
39 br i1 %2, label %catch, label %eh.resume
41 catch: ; preds = %lpad
42 %3 = tail call i8* @__cxa_begin_catch(i8* %exn) nounwind
43 %4 = bitcast i8* %3 to double*
44 %exn.scalar = load double* %4, align 8
45 %add = fadd double %exn.scalar, %i2
46 store double %add, double* @g1, align 8, !tbaa !0
47 tail call void @__cxa_end_catch() nounwind
50 eh.resume: ; preds = %lpad
51 tail call void @llvm.eh.resume(i8* %exn, i32 %eh.selector) noreturn
54 unreachable: ; preds = %entry
58 declare i8* @__cxa_allocate_exception(i32)
60 declare i8* @llvm.eh.exception() nounwind readonly
62 declare i32 @__gxx_personality_v0(...)
64 declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
66 declare i32 @llvm.eh.typeid.for(i8*) nounwind
68 declare void @llvm.eh.resume(i8*, i32)
70 declare void @__cxa_throw(i8*, i8*, i8*)
72 declare i8* @__cxa_begin_catch(i8*)
74 declare void @__cxa_end_catch()
76 !0 = metadata !{metadata !"double", metadata !1}
77 !1 = metadata !{metadata !"omnipotent char", metadata !2}
78 !2 = metadata !{metadata !"Simple C/C++ TBAA", null}