1; RUN: opt -ee-instrument < %s | opt -inline | llc -mtriple=powerpc64-unknown-linux-gnu | 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"
6
7
8define void @leaf_function() #0 {
9entry:
10  ret void
11
12; CHECK-LABEL: leaf_function:
13; CHECK: bl mcount
14; CHECK-NOT: bl
15; CHECK: bl __cyg_profile_func_enter
16; CHECK-NOT: bl
17; CHECK: bl __cyg_profile_func_exit
18; CHECK-NOT: bl
19; CHECK: blr
20}
21
22
23define void @root_function() #0 {
24entry:
25  call void @leaf_function()
26  ret void
27
28; CHECK-LABEL: root_function:
29; CHECK: bl mcount
30; CHECK-NOT: bl
31; CHECK: bl __cyg_profile_func_enter
32; CHECK-NOT: bl
33
34; Entry and exit calls, inlined from @leaf_function()
35; CHECK: bl __cyg_profile_func_enter
36; CHECK-NOT: bl
37; CHECK: bl __cyg_profile_func_exit
38; CHECK-NOT: bl
39
40; CHECK: bl __cyg_profile_func_exit
41; CHECK-NOT: bl
42; CHECK: blr
43}
44
45attributes #0 = { "instrument-function-entry-inlined"="mcount" "instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" }
46