• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -ee-instrument < %s | opt -inline | llc | FileCheck %s
2
3; The run-line mimics how Clang might run the instrumentation passes.
4
5target datalayout = "E-m:e-i64:64-n32:64"
6target triple = "powerpc64-bgq-linux"
7
8
9define void @leaf_function() #0 {
10entry:
11  ret void
12
13; CHECK-LABEL: leaf_function:
14; CHECK: bl mcount
15; CHECK-NOT: bl
16; CHECK: bl __cyg_profile_func_enter
17; CHECK-NOT: bl
18; CHECK: bl __cyg_profile_func_exit
19; CHECK-NOT: bl
20; CHECK: blr
21}
22
23
24define void @root_function() #0 {
25entry:
26  call void @leaf_function()
27  ret void
28
29; CHECK-LABEL: root_function:
30; CHECK: bl mcount
31; CHECK-NOT: bl
32; CHECK: bl __cyg_profile_func_enter
33; CHECK-NOT: bl
34
35; Entry and exit calls, inlined from @leaf_function()
36; CHECK: bl __cyg_profile_func_enter
37; CHECK-NOT: bl
38; CHECK: bl __cyg_profile_func_exit
39; CHECK-NOT: bl
40
41; CHECK: bl __cyg_profile_func_exit
42; CHECK-NOT: bl
43; CHECK: blr
44}
45
46attributes #0 = { "instrument-function-entry-inlined"="mcount" "instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" }
47