45 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i386-- | FileCheck %s3 4; FIXME: umul-with-overflow not supported yet.5 6@ok = internal constant [4 x i8] c"%d\0A\00"7@no = internal constant [4 x i8] c"no\0A\00"8 9define i1 @func(i32 %v1, i32 %v2) nounwind {10; CHECK-LABEL: func:11; CHECK: # %bb.0: # %entry12; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax13; CHECK-NEXT: mull {{[0-9]+}}(%esp)14; CHECK-NEXT: jno .LBB0_115; CHECK-NEXT: # %bb.2: # %carry16; CHECK-NEXT: pushl $no17; CHECK-NEXT: calll printf@PLT18; CHECK-NEXT: addl $4, %esp19; CHECK-NEXT: xorl %eax, %eax20; CHECK-NEXT: retl21; CHECK-NEXT: .LBB0_1: # %normal22; CHECK-NEXT: pushl %eax23; CHECK-NEXT: pushl $ok24; CHECK-NEXT: calll printf@PLT25; CHECK-NEXT: addl $8, %esp26; CHECK-NEXT: movb $1, %al27; CHECK-NEXT: retl28entry:29 %t = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %v1, i32 %v2)30 %sum = extractvalue {i32, i1} %t, 031 %obit = extractvalue {i32, i1} %t, 132 br i1 %obit, label %carry, label %normal33 34normal:35 %t1 = tail call i32 (ptr, ...) @printf( ptr @ok, i32 %sum ) nounwind36 ret i1 true37 38carry:39 %t2 = tail call i32 (ptr, ...) @printf( ptr @no ) nounwind40 ret i1 false41}42 43declare i32 @printf(ptr, ...) nounwind44declare {i32, i1} @llvm.umul.with.overflow.i32(i32, i32)45