summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-09-26 08:38:07 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-09-26 08:38:07 +0000
commit6e504d770653e0ab392bf264b76efba461b8aebd (patch)
treec9415b7b75e2f3604b72f2da6c670df0513f9f70 /llvm/test/CodeGen/SystemZ
parentb6c80623d1379130dd1666db0e700b6a8046eb3b (diff)
downloadbcm5719-llvm-6e504d770653e0ab392bf264b76efba461b8aebd.tar.gz
bcm5719-llvm-6e504d770653e0ab392bf264b76efba461b8aebd.zip
[SystemZ] Recognize mnop-mcount in backend
With -pg -mfentry -mnop-mcount, a nop is emitted instead of the call to fentry. Review: Ulrich Weigand https://reviews.llvm.org/D67765 llvm-svn: 372950
Diffstat (limited to 'llvm/test/CodeGen/SystemZ')
-rw-r--r--llvm/test/CodeGen/SystemZ/mnop-mcount-01.ll26
-rw-r--r--llvm/test/CodeGen/SystemZ/mnop-mcount-02.ll11
2 files changed, 37 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/mnop-mcount-01.ll b/llvm/test/CodeGen/SystemZ/mnop-mcount-01.ll
new file mode 100644
index 00000000000..38f1db537b5
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/mnop-mcount-01.ll
@@ -0,0 +1,26 @@
+; RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z10 -o - -verify-machineinstrs \
+; RUN: | FileCheck %s
+
+define void @test1() #0 {
+entry:
+ ret void
+
+; CHECK-LABEL: @test1
+; CHECK: brasl %r0, __fentry__
+; CHECK-NOT: brcl 0, .Ltmp0
+; CHECK: br %r14
+}
+
+define void @test2() #1 {
+entry:
+ ret void
+
+; CHECK-LABEL: @test2
+; CHECK-NOT: brasl %r0, __fentry__
+; CHECK: brcl 0, .Ltmp0
+; CHECK: br %r14
+}
+
+attributes #0 = { "fentry-call"="true" }
+attributes #1 = { "fentry-call"="true" "mnop-mcount"="true" }
+
diff --git a/llvm/test/CodeGen/SystemZ/mnop-mcount-02.ll b/llvm/test/CodeGen/SystemZ/mnop-mcount-02.ll
new file mode 100644
index 00000000000..19b1724d16a
--- /dev/null
+++ b/llvm/test/CodeGen/SystemZ/mnop-mcount-02.ll
@@ -0,0 +1,11 @@
+; RUN: not llc %s -mtriple=s390x-linux-gnu -o - 2>&1 | FileCheck %s
+;
+; CHECK: LLVM ERROR: mnop-mcount only supported with fentry-call
+
+define void @test1() #0 {
+entry:
+ ret void
+}
+
+attributes #0 = { "instrument-function-entry-inlined"="mcount" "mnop-mcount"="true" }
+
OpenPOWER on IntegriCloud