1 // Test if memprof instrumentation and use pass are invoked.
4 // Ensure Pass MemProfilerPass and ModuleMemProfilerPass are invoked.
5 // RUN: %clang_cc1 -O2 -fmemory-profile %s -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=INSTRUMENT
6 // INSTRUMENT: Running pass: MemProfilerPass on main
7 // INSTRUMENT: Running pass: ModuleMemProfilerPass on [module]
9 // Avoid failures on big-endian systems that can't read the raw profile properly
10 // REQUIRES: x86_64-linux
12 // TODO: Use text profile inputs once that is available for memprof.
14 // To update the inputs below, run Inputs/update_memprof_inputs.sh
15 // RUN: llvm-profdata merge %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe -o %t.memprofdata
18 // Ensure Pass PGOInstrumentationUse is invoked with the memprof-only profile.
19 // RUN: %clang_cc1 -O2 -fmemory-profile-use=%t.memprofdata %s -fdebug-pass-manager -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=USE
20 // USE: Running pass: MemProfUsePass on [module]