1 ; Test strcmp using CLST, i32 version.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare signext i32 @strcmp(ptr %src1, ptr %src2)
7 ; Check a case where the result is used as an integer.
8 define i32 @f1(ptr %src1, ptr %src2) {
11 ; CHECK: [[LABEL:\.[^:]*]]:
12 ; CHECK: clst %r3, %r2
13 ; CHECK-NEXT: jo [[LABEL]]
14 ; CHECK-NEXT: %bb.{{[0-9]+}}
19 %res = call i32 @strcmp(ptr %src1, ptr %src2)
23 ; Check a case where the result is tested for equality.
24 define void @f2(ptr %src1, ptr %src2, ptr %dest) {
27 ; CHECK: [[LABEL:\.[^:]*]]:
28 ; CHECK: clst %r3, %r2
29 ; CHECK-NEXT: jo [[LABEL]]
30 ; CHECK-NEXT: %bb.{{[0-9]+}}
31 ; CHECK-NEXT: ber %r14
33 %res = call i32 @strcmp(ptr %src1, ptr %src2)
34 %cmp = icmp eq i32 %res, 0
35 br i1 %cmp, label %exit, label %store
38 store i32 0, ptr %dest
45 ; Test a case where the result is used both as an integer and for
47 define i32 @f3(ptr %src1, ptr %src2, ptr %dest) {
50 ; CHECK: [[LABEL:\.[^:]*]]:
51 ; CHECK: clst %r3, %r2
52 ; CHECK-NEXT: jo [[LABEL]]
53 ; CHECK-NEXT: %bb.{{[0-9]+}}
60 %res = call i32 @strcmp(ptr %src1, ptr %src2)
61 %cmp = icmp slt i32 %res, 0
62 br i1 %cmp, label %exit, label %store
65 store i32 0, ptr %dest