summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/PowerPC/mcount-insertion.ll40
-rw-r--r--llvm/test/CodeGen/X86/O0-pipeline.ll2
2 files changed, 36 insertions, 6 deletions
diff --git a/llvm/test/CodeGen/PowerPC/mcount-insertion.ll b/llvm/test/CodeGen/PowerPC/mcount-insertion.ll
index 04e8571d6f4..cbb7947be21 100644
--- a/llvm/test/CodeGen/PowerPC/mcount-insertion.ll
+++ b/llvm/test/CodeGen/PowerPC/mcount-insertion.ll
@@ -1,16 +1,46 @@
-; RUN: llc < %s | FileCheck %s
+; RUN: opt -ee-instrument < %s | opt -inline | llc | FileCheck %s
+
+; The run-line mimics how Clang might run the instrumentation passes.
+
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-bgq-linux"
-define void @test1() #0 {
+
+define void @leaf_function() #0 {
entry:
ret void
-; CHECK-LABEL: @test1
+; CHECK-LABEL: leaf_function:
; CHECK: bl mcount
-; CHECK-NOT: mcount
+; CHECK-NOT: bl
+; CHECK: bl __cyg_profile_func_enter
+; CHECK-NOT: bl
+; CHECK: bl __cyg_profile_func_exit
+; CHECK-NOT: bl
; CHECK: blr
}
-attributes #0 = { "counting-function"="mcount" }
+define void @root_function() #0 {
+entry:
+ call void @leaf_function()
+ ret void
+
+; CHECK-LABEL: root_function:
+; CHECK: bl mcount
+; CHECK-NOT: bl
+; CHECK: bl __cyg_profile_func_enter
+; CHECK-NOT: bl
+
+; Entry and exit calls, inlined from @leaf_function()
+; CHECK: bl __cyg_profile_func_enter
+; CHECK-NOT: bl
+; CHECK: bl __cyg_profile_func_exit
+; CHECK-NOT: bl
+
+; CHECK: bl __cyg_profile_func_exit
+; CHECK-NOT: bl
+; CHECK: blr
+}
+
+attributes #0 = { "instrument-function-entry-inlined"="mcount" "instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" }
diff --git a/llvm/test/CodeGen/X86/O0-pipeline.ll b/llvm/test/CodeGen/X86/O0-pipeline.ll
index 1f7415ee2af..cb7dabefe45 100644
--- a/llvm/test/CodeGen/X86/O0-pipeline.ll
+++ b/llvm/test/CodeGen/X86/O0-pipeline.ll
@@ -22,7 +22,7 @@
; CHECK-NEXT: Lower Garbage Collection Instructions
; CHECK-NEXT: Shadow Stack GC Lowering
; CHECK-NEXT: Remove unreachable blocks from the CFG
-; CHECK-NEXT: Inserts calls to mcount-like functions
+; CHECK-NEXT: Instrument function entry/exit with calls to e.g. mcount() (post inlining)
; CHECK-NEXT: Scalarize Masked Memory Intrinsics
; CHECK-NEXT: Expand reduction intrinsics
; CHECK-NEXT: Rewrite Symbols
OpenPOWER on IntegriCloud