blob: cbb7947be2198f78a54ded9c20196e6051908103 [file] [log] [blame]
Hans Wennborge1ecd612017-11-14 21:09:45 +00001; RUN: opt -ee-instrument < %s | opt -inline | llc | FileCheck %s
2
3; The run-line mimics how Clang might run the instrumentation passes.
4
Hal Finkel40d7f5c2016-09-01 09:42:39 +00005target datalayout = "E-m:e-i64:64-n32:64"
6target triple = "powerpc64-bgq-linux"
7
Hans Wennborge1ecd612017-11-14 21:09:45 +00008
9define void @leaf_function() #0 {
Hal Finkel40d7f5c2016-09-01 09:42:39 +000010entry:
11 ret void
12
Hans Wennborge1ecd612017-11-14 21:09:45 +000013; CHECK-LABEL: leaf_function:
Hal Finkel40d7f5c2016-09-01 09:42:39 +000014; CHECK: bl mcount
Hans Wennborge1ecd612017-11-14 21:09:45 +000015; 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
Hal Finkel40d7f5c2016-09-01 09:42:39 +000020; CHECK: blr
21}
22
Hal Finkel40d7f5c2016-09-01 09:42:39 +000023
Hans Wennborge1ecd612017-11-14 21:09:45 +000024define 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" }