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.
16 lines
521 B
C++
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;
|
|
}
|