43 lines · plain
1; Test that strcmp won't be converted to MVST if calls are2; marked with nobuiltin, eg. for sanitizers.3;4; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s5 6declare ptr@strcpy(ptr %dest, ptr %src)7declare ptr@stpcpy(ptr %dest, ptr %src)8 9; Check strcpy.10define ptr@f1(ptr %dest, ptr %src) {11; CHECK-LABEL: f1:12; CHECK-NOT: mvst13; CHECK: brasl %r14, strcpy14; CHECK: br %r1415 %res = call ptr@strcpy(ptr %dest, ptr %src) nobuiltin16 ret ptr %res17}18 19; Check stpcpy.20define ptr@f2(ptr %dest, ptr %src) {21; CHECK-LABEL: f2:22; CHECK-NOT: mvst23; CHECK: brasl %r14, stpcpy24; CHECK: br %r1425 %res = call ptr@stpcpy(ptr %dest, ptr %src) nobuiltin26 ret ptr %res27}28 29; Check correct operation with other loads and stores. The load must30; come before the loop and the store afterwards.31define i32 @f3(i32 %dummy, ptr %dest, ptr %src, ptr %resptr, ptr %storeptr) {32; CHECK-LABEL: f3:33; CHECK-DAG: l [[REG1:%r[0-9]+]], 0(%r5)34; CHECK-NOT: mvst35; CHECK: brasl %r14, strcpy36; CHECK: mvhi 0(%r6), 037; CHECK: br %r1438 %res = load i32, ptr %resptr39 %unused = call ptr@strcpy(ptr %dest, ptr %src) nobuiltin40 store i32 0, ptr %storeptr41 ret i32 %res42}43