1 ; RUN: llc -march=mips < %s | FileCheck %s 2 3 ; CHECK: div $zero, 4 define i32 @sdiv1(i32 %a0, i32 %a1) nounwind readnone { 5 entry: 6 %div = sdiv i32 %a0, %a1 7 ret i32 %div 8 } 9 10 ; CHECK: div $zero, 11 define i32 @srem1(i32 %a0, i32 %a1) nounwind readnone { 12 entry: 13 %rem = srem i32 %a0, %a1 14 ret i32 %rem 15 } 16 17 ; CHECK: divu $zero, 18 define i32 @udiv1(i32 %a0, i32 %a1) nounwind readnone { 19 entry: 20 %div = udiv i32 %a0, %a1 21 ret i32 %div 22 } 23 24 ; CHECK: divu $zero, 25 define i32 @urem1(i32 %a0, i32 %a1) nounwind readnone { 26 entry: 27 %rem = urem i32 %a0, %a1 28 ret i32 %rem 29 } 30 31 ; CHECK: div $zero, 32 define i32 @sdivrem1(i32 %a0, i32 %a1, i32* nocapture %r) nounwind { 33 entry: 34 %rem = srem i32 %a0, %a1 35 store i32 %rem, i32* %r, align 4, !tbaa !0 36 %div = sdiv i32 %a0, %a1 37 ret i32 %div 38 } 39 40 ; CHECK: divu $zero, 41 define i32 @udivrem1(i32 %a0, i32 %a1, i32* nocapture %r) nounwind { 42 entry: 43 %rem = urem i32 %a0, %a1 44 store i32 %rem, i32* %r, align 4, !tbaa !0 45 %div = udiv i32 %a0, %a1 46 ret i32 %div 47 } 48 49 !0 = metadata !{metadata !"int", metadata !1} 50 !1 = metadata !{metadata !"omnipotent char", metadata !2} 51 !2 = metadata !{metadata !"Simple C/C++ TBAA", null} 52