48 lines · plain
1; REQUIRES: x86_64-linux2;3; Check that, if none of the roots in the profile are defined in the module, the4; profile is treated as empty (i.e. "none provided")5;6; RUN: rm -rf %t7; RUN: split-file %s %t8; RUN: llvm-ctxprof-util fromYAML --input=%t/profile.yaml --output=%t/profile.ctxprofdata9; RUN: opt -passes='require<ctx-prof-analysis>,print<ctx-prof-analysis>' -ctx-profile-printer-level=everything \10; RUN: %t/example.ll -S 2>&1 | FileCheck %s11 12; CHECK: No contextual profile was provided13;14; This is the reference profile, laid out in the format the json formatter will15; output it from opt. Note that the root GUIDs - 12341 and 34234 - are different from16; the GUID present in the module, which is otherwise present in the profile, but not17; as a root.18;--- profile.yaml19Contexts:20 - Guid: 1234121 TotalRootEntryCount: 2422 Counters: [9]23 - Guid: 100024 TotalRootEntryCount: 2525 Counters: [5]26 - Guid: 3423427 TotalRootEntryCount: 228 Counters: [1]29 Callsites: -30 - Guid: 100031 Counters: [6, 7]32;--- example.ll33declare void @bar()34 35define void @an_entrypoint(i32 %a) !guid !0 {36 %t = icmp eq i32 %a, 037 br i1 %t, label %yes, label %no38 39yes:40 call void @bar()41 ret void42no:43 ret void44}45 46attributes #0 = { noinline }47!0 = !{ i64 1000 }48