1 ; RUN: llc < %s -march=c
2 ; Check that uadd and sadd with overflow are handled by C Backend.
4 %0 = type { i32, i1 } ; type %0
6 define i1 @func1(i32 zeroext %v1, i32 zeroext %v2) nounwind {
8 %t = call %0 @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2) ; <%0> [#uses=1]
9 %obit = extractvalue %0 %t, 1 ; <i1> [#uses=1]
10 br i1 %obit, label %carry, label %normal
12 normal: ; preds = %entry
15 carry: ; preds = %entry
19 define i1 @func2(i32 signext %v1, i32 signext %v2) nounwind {
21 %t = call %0 @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2) ; <%0> [#uses=1]
22 %obit = extractvalue %0 %t, 1 ; <i1> [#uses=1]
23 br i1 %obit, label %carry, label %normal
25 normal: ; preds = %entry
28 carry: ; preds = %entry
32 declare %0 @llvm.sadd.with.overflow.i32(i32, i32) nounwind
34 declare %0 @llvm.uadd.with.overflow.i32(i32, i32) nounwind