summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/PowerPC/mcount-insertion.ll16
-rw-r--r--llvm/test/Transforms/CountingFunctionInserter/mcount.ll27
2 files changed, 43 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/mcount-insertion.ll b/llvm/test/CodeGen/PowerPC/mcount-insertion.ll
new file mode 100644
index 00000000000..04e8571d6f4
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/mcount-insertion.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s | FileCheck %s
+target datalayout = "E-m:e-i64:64-n32:64"
+target triple = "powerpc64-bgq-linux"
+
+define void @test1() #0 {
+entry:
+ ret void
+
+; CHECK-LABEL: @test1
+; CHECK: bl mcount
+; CHECK-NOT: mcount
+; CHECK: blr
+}
+
+attributes #0 = { "counting-function"="mcount" }
+
diff --git a/llvm/test/Transforms/CountingFunctionInserter/mcount.ll b/llvm/test/Transforms/CountingFunctionInserter/mcount.ll
new file mode 100644
index 00000000000..88297c7d825
--- /dev/null
+++ b/llvm/test/Transforms/CountingFunctionInserter/mcount.ll
@@ -0,0 +1,27 @@
+; RUN: opt -S -cfinserter < %s | FileCheck %s
+target datalayout = "E-m:e-i64:64-n32:64"
+target triple = "powerpc64-bgq-linux"
+
+define void @test1() #0 {
+entry:
+ ret void
+
+; CHECK-LABEL: define void @test1()
+; CHECK: entry:
+; CHECK-NEXT: call void @mcount()
+; CHECK: ret void
+}
+
+define void @test2() #1 {
+entry:
+ ret void
+
+; CHECK-LABEL: define void @test2()
+; CHECK: entry:
+; CHECK-NEXT: call void @.mcount()
+; CHECK: ret void
+}
+
+attributes #0 = { "counting-function"="mcount" }
+attributes #1 = { "counting-function"=".mcount" }
+
OpenPOWER on IntegriCloud