summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll')
-rw-r--r--llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll b/llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll
new file mode 100644
index 00000000000..f94e1162ae4
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/memchr-nobuiltin.ll
@@ -0,0 +1,16 @@
+; Test that memchr won't be converted to SRST if calls are
+; marked with nobuiltin, eg. for sanitizers.
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
+
+declare i8 *@memchr(i8 *%src, i16 %char, i32 %len)
+
+; Test a simple forwarded call.
+define i8 *@f1(i8 *%src, i16 %char, i32 %len) {
+; CHECK-LABEL: f1:
+; CHECK-NOT: srst
+; CHECK: brasl %r14, memchr
+; CHECK: br %r14
+ %res = call i8 *@memchr(i8 *%src, i16 %char, i32 %len) nobuiltin
+ ret i8 *%res
+}
OpenPOWER on IntegriCloud