1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s
4 declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32)
5 declare {i32, i1} @llvm.uadd.with.overflow.i32(i32, i32)
7 define fastcc i32 @test5(i32 %v1, i32 %v2, ptr %X) nounwind {
9 ; CHECK: ; %bb.0: ; %entry
10 ; CHECK-NEXT: add.l %d1, %d0
11 ; CHECK-NEXT: bvs .LBB0_2
12 ; CHECK-NEXT: ; %bb.1: ; %normal
13 ; CHECK-NEXT: move.l #0, (%a0)
14 ; CHECK-NEXT: .LBB0_2: ; %overflow
17 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
18 %sum = extractvalue {i32, i1} %t, 0
19 %obit = extractvalue {i32, i1} %t, 1
20 br i1 %obit, label %overflow, label %normal
30 define fastcc i1 @test6(i32 %v1, i32 %v2, ptr %X) nounwind {
32 ; CHECK: ; %bb.0: ; %entry
33 ; CHECK-NEXT: add.l %d1, %d0
34 ; CHECK-NEXT: bcs .LBB1_2
35 ; CHECK-NEXT: ; %bb.1: ; %normal
36 ; CHECK-NEXT: move.l #0, (%a0)
37 ; CHECK-NEXT: .LBB1_2: ; %carry
38 ; CHECK-NEXT: moveq #0, %d0
41 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
42 %sum = extractvalue {i32, i1} %t, 0
43 %obit = extractvalue {i32, i1} %t, 1
44 br i1 %obit, label %carry, label %normal
54 define {i32, i1} @test7(i32 %v1, i32 %v2) nounwind {
57 ; CHECK-NEXT: move.l (4,%sp), %d0
58 ; CHECK-NEXT: add.l (8,%sp), %d0
61 %t = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %v1, i32 %v2)
65 define fastcc i1 @test10(i32 %x) nounwind {
66 ; CHECK-LABEL: test10:
67 ; CHECK: ; %bb.0: ; %entry
68 ; CHECK-NEXT: add.l #1, %d0
72 %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %x, i32 1)
73 %obit = extractvalue {i32, i1} %t, 1