1 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z15 | FileCheck %s
3 ; Test that a CC result of a sub that can overflow is tested with the right predicate.
5 define i32 @fun0(i32 %a, i32 %b, ptr %dest) {
10 %cur = load i32, ptr %dest
11 %res = sub nsw i32 %a, %cur
12 %cmp = icmp ne i32 %a, %cur
13 br i1 %cmp, label %exit, label %store
16 store i32 %b, ptr %dest
23 define i32 @fun1(i32 %a, i32 %b, ptr %dest) {
25 ; CHECK: s %r2, 0(%r4)
28 %cur = load i32, ptr %dest
29 %res = sub nuw i32 %a, %cur
30 %cmp = icmp ne i32 %a, %cur
31 br i1 %cmp, label %exit, label %store
34 store i32 %b, ptr %dest