1 ; RUN: llc < %s -march=mipsel | FileCheck %s -check-prefix=CHECK-EL
2 ; RUN: llc < %s -march=mips | 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.val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
36 catch i8* bitcast (i8** @_ZTId to i8*)
37 %exn = extractvalue { i8*, i32 } %exn.val, 0
38 %sel = extractvalue { i8*, i32 } %exn.val, 1
39 %1 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTId to i8*)) nounwind
40 %2 = icmp eq i32 %sel, %1
41 br i1 %2, label %catch, label %eh.resume
43 catch: ; preds = %lpad
44 %3 = tail call i8* @__cxa_begin_catch(i8* %exn) nounwind
45 %4 = bitcast i8* %3 to double*
46 %exn.scalar = load double* %4, align 8
47 %add = fadd double %exn.scalar, %i2
48 store double %add, double* @g1, align 8, !tbaa !0
49 tail call void @__cxa_end_catch() nounwind
52 eh.resume: ; preds = %lpad
53 resume { i8*, i32 } %exn.val
55 unreachable: ; preds = %entry
59 declare i8* @__cxa_allocate_exception(i32)
61 declare i8* @llvm.eh.exception() nounwind readonly
63 declare i32 @__gxx_personality_v0(...)
65 declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind
67 declare i32 @llvm.eh.typeid.for(i8*) nounwind
69 declare void @llvm.eh.resume(i8*, i32)
71 declare void @__cxa_throw(i8*, i8*, i8*)
73 declare i8* @__cxa_begin_catch(i8*)
75 declare void @__cxa_end_catch()
77 !0 = metadata !{metadata !"double", metadata !1}
78 !1 = metadata !{metadata !"omnipotent char", metadata !2}
79 !2 = metadata !{metadata !"Simple C/C++ TBAA", null}