Files
clang-p2996/compiler-rt/test/memprof/TestCases/default_options.cpp
Ellis Hoag 2e33ed9ecc [memprof] Use -memprof-runtime-default-options to set options during compile time (#118874)
Add the `__memprof_default_options_str` variable, initialized via the
`-memprof-runtime-default-options` LLVM flag, to hold the default options string
for memprof. This allows us to set these options during compile time in
the clang invocation.

Also update the docs to describe the various ways to set these options.
2024-12-06 09:22:16 -08:00

16 lines
521 B
C++

// RUN: %clangxx_memprof -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
// Check that overriding __memprof_default_options() takes precedence over the LLVM flag
// RUN: %clangxx_memprof -O2 %s -o %t-flag -mllvm -memprof-runtime-default-options="verbosity=0 help=0" && %run %t-flag 2>&1 | FileCheck %s
const char *kMemProfDefaultOptions = "verbosity=1 help=1";
extern "C" const char *__memprof_default_options() {
// CHECK: Available flags for MemProfiler:
return kMemProfDefaultOptions;
}
int main() {
return 0;
}