1 ; RUN: llc < %s -march=x86 | FileCheck %s
3 @ok = internal constant [4 x i8] c"%d\0A\00"
4 @no = internal constant [4 x i8] c"no\0A\00"
6 define i1 @func1(i32 %v1, i32 %v2) nounwind {
8 %t = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %v1, i32 %v2)
9 %sum = extractvalue {i32, i1} %t, 0
10 %obit = extractvalue {i32, i1} %t, 1
11 br i1 %obit, label %overflow, label %normal
14 %t1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @ok, i32 0, i32 0), i32 %sum ) nounwind
18 %t2 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @no, i32 0, i32 0) ) nounwind
22 ; CHECK: subl 20(%esp)
26 define i1 @func2(i32 %v1, i32 %v2) nounwind {
28 %t = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %v1, i32 %v2)
29 %sum = extractvalue {i32, i1} %t, 0
30 %obit = extractvalue {i32, i1} %t, 1
31 br i1 %obit, label %carry, label %normal
34 %t1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @ok, i32 0, i32 0), i32 %sum ) nounwind
38 %t2 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @no, i32 0, i32 0) ) nounwind
42 ; CHECK: subl 20(%esp)
46 declare i32 @printf(i8*, ...) nounwind
47 declare {i32, i1} @llvm.ssub.with.overflow.i32(i32, i32)
48 declare {i32, i1} @llvm.usub.with.overflow.i32(i32, i32)
50 define i1 @func3(i32 %x) nounwind {
52 %t = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %x, i32 1)
53 %obit = extractvalue {i32, i1} %t, 1