1; Test that strcmp won't be converted to MVST if calls are
2; marked with nobuiltin, eg. for sanitizers.
3;
4; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5
6declare i8 *@strcpy(i8 *%dest, i8 *%src)
7declare i8 *@stpcpy(i8 *%dest, i8 *%src)
8
9; Check strcpy.
10define i8 *@f1(i8 *%dest, i8 *%src) {
11; CHECK-LABEL: f1:
12; CHECK-NOT: mvst
13; CHECK: brasl %r14, strcpy
14; CHECK: br %r14
15  %res = call i8 *@strcpy(i8 *%dest, i8 *%src) nobuiltin
16  ret i8 *%res
17}
18
19; Check stpcpy.
20define i8 *@f2(i8 *%dest, i8 *%src) {
21; CHECK-LABEL: f2:
22; CHECK-NOT: mvst
23; CHECK: brasl %r14, stpcpy
24; CHECK: br %r14
25  %res = call i8 *@stpcpy(i8 *%dest, i8 *%src) nobuiltin
26  ret i8 *%res
27}
28
29; Check correct operation with other loads and stores.  The load must
30; come before the loop and the store afterwards.
31define i32 @f3(i32 %dummy, i8 *%dest, i8 *%src, i32 *%resptr, i32 *%storeptr) {
32; CHECK-LABEL: f3:
33; CHECK-DAG: l [[REG1:%r[0-9]+]], 0(%r5)
34; CHECK-NOT: mvst
35; CHECK: brasl %r14, strcpy
36; CHECK: mvhi 0(%r6), 0
37; CHECK: br %r14
38  %res = load i32, i32 *%resptr
39  %unused = call i8 *@strcpy(i8 *%dest, i8 *%src) nobuiltin
40  store i32 0, i32 *%storeptr
41  ret i32 %res
42}
43