1 ; RUN: llc < %s -mtriple=mipsel | FileCheck %s -check-prefix=CHECK-EL
2 ; RUN: llc < %s -mtriple=mips | FileCheck %s -check-prefix=CHECK-EB
4 @g1 = global double 0.000000e+00, align 8
5 @_ZTId = external constant ptr
7 define void @_Z1fd(double %i2) personality ptr @__gxx_personality_v0 {
9 ; CHECK-EL: addiu $sp, $sp
10 ; CHECK-EL: .cfi_def_cfa_offset
13 ; CHECK-EL: .cfi_offset 52, -8
14 ; CHECK-EL: .cfi_offset 53, -4
15 ; CHECK-EB: .cfi_offset 53, -8
16 ; CHECK-EB: .cfi_offset 52, -4
17 ; CHECK-EL: .cfi_offset 31, -12
19 %exception = tail call ptr @__cxa_allocate_exception(i32 8) nounwind
20 store double 3.200000e+00, ptr %exception, align 8
21 invoke void @__cxa_throw(ptr %exception, ptr @_ZTId, ptr null) noreturn
22 to label %unreachable unwind label %lpad
24 lpad: ; preds = %entry
28 %exn.val = landingpad { ptr, i32 }
31 %exn = extractvalue { ptr, i32 } %exn.val, 0
32 %sel = extractvalue { ptr, i32 } %exn.val, 1
33 %0 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTId) nounwind
34 %1 = icmp eq i32 %sel, %0
35 br i1 %1, label %catch, label %eh.resume
37 catch: ; preds = %lpad
38 %2 = tail call ptr @__cxa_begin_catch(ptr %exn) nounwind
39 %exn.scalar = load double, ptr %2, align 8
40 %add = fadd double %exn.scalar, %i2
41 store double %add, ptr @g1, align 8
42 tail call void @__cxa_end_catch() nounwind
45 eh.resume: ; preds = %lpad
46 resume { ptr, i32 } %exn.val
48 unreachable: ; preds = %entry
52 declare ptr @__cxa_allocate_exception(i32)
54 declare i32 @__gxx_personality_v0(...)
56 declare i32 @llvm.eh.typeid.for(ptr) nounwind
58 declare void @__cxa_throw(ptr, ptr, ptr)
60 declare ptr @__cxa_begin_catch(ptr)
62 declare void @__cxa_end_catch()