1 ; Test strcmp using CLST, i32 version.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare signext i32 @strcmp(i8 *%src1, i8 *%src2)
7 ; Check a case where the result is used as an integer.
8 define i32 @f1(i8 *%src1, i8 *%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(i8 *%src1, i8 *%src2)
23 ; Check a case where the result is tested for equality.
24 define void @f2(i8 *%src1, i8 *%src2, i32 *%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(i8 *%src1, i8 *%src2)
34 %cmp = icmp eq i32 %res, 0
35 br i1 %cmp, label %exit, label %store
38 store i32 0, i32 *%dest
45 ; Test a case where the result is used both as an integer and for
47 define i32 @f3(i8 *%src1, i8 *%src2, i32 *%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(i8 *%src1, i8 *%src2)
61 %cmp = icmp slt i32 %res, 0
62 br i1 %cmp, label %exit, label %store
65 store i32 0, i32 *%dest