Home | History | Annotate | Download | only in Mips
      1 ; RUN: llc  < %s -march=mipsel | FileCheck %s -check-prefix=CHECK-EL
      2 ; RUN: llc  < %s -march=mips   | FileCheck %s -check-prefix=CHECK-EB
      3 
      4 @g1 = global double 0.000000e+00, align 8
      5 @_ZTId = external constant i8*
      6 
      7 define void @_Z1fd(double %i2) personality i32 (...)* @__gxx_personality_v0 {
      8 entry:
      9 ; CHECK-EL:  addiu $sp, $sp
     10 ; CHECK-EL:  .cfi_def_cfa_offset
     11 ; CHECK-EL:  sdc1 $f20
     12 ; CHECK-EL:  sw  $ra
     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
     18 
     19   %exception = tail call i8* @__cxa_allocate_exception(i32 8) nounwind
     20   %0 = bitcast i8* %exception to double*
     21   store double 3.200000e+00, double* %0, align 8
     22   invoke void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTId to i8*), i8* null) noreturn
     23           to label %unreachable unwind label %lpad
     24 
     25 lpad:                                             ; preds = %entry
     26 ; CHECK-EL:  # %lpad
     27 ; CHECK-EL:  beq $5
     28 
     29   %exn.val = landingpad { i8*, i32 }
     30            cleanup
     31            catch i8* bitcast (i8** @_ZTId to i8*)
     32   %exn = extractvalue { i8*, i32 } %exn.val, 0
     33   %sel = extractvalue { i8*, i32 } %exn.val, 1
     34   %1 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTId to i8*)) nounwind
     35   %2 = icmp eq i32 %sel, %1
     36   br i1 %2, label %catch, label %eh.resume
     37 
     38 catch:                                            ; preds = %lpad
     39   %3 = tail call i8* @__cxa_begin_catch(i8* %exn) nounwind
     40   %4 = bitcast i8* %3 to double*
     41   %exn.scalar = load double, double* %4, align 8
     42   %add = fadd double %exn.scalar, %i2
     43   store double %add, double* @g1, align 8
     44   tail call void @__cxa_end_catch() nounwind
     45   ret void
     46 
     47 eh.resume:                                        ; preds = %lpad
     48   resume { i8*, i32 } %exn.val
     49 
     50 unreachable:                                      ; preds = %entry
     51   unreachable
     52 }
     53 
     54 declare i8* @__cxa_allocate_exception(i32)
     55 
     56 declare i32 @__gxx_personality_v0(...)
     57 
     58 declare i32 @llvm.eh.typeid.for(i8*) nounwind
     59 
     60 declare void @__cxa_throw(i8*, i8*, i8*)
     61 
     62 declare i8* @__cxa_begin_catch(i8*)
     63 
     64 declare void @__cxa_end_catch()
     65