From 87f217d20bb24fa92a5882c2a565e1f14ad41e85 Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Mon, 31 Jul 2017 05:16:20 +0000 Subject: [XRay][compiler-rt] Do not print the warning when the binary is not XRay instrumented. Summary: Currently when the XRay runtime is linked into a binary that doesn't have the instrumentation map, we print a warning unconditionally. This change attempts to make this behaviour more quiet. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35789 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309534 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/xray/TestCases/Linux/quiet-start.cc | 22 ++++++++++++++++++++++ test/xray/lit.cfg | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 test/xray/TestCases/Linux/quiet-start.cc (limited to 'test') diff --git a/test/xray/TestCases/Linux/quiet-start.cc b/test/xray/TestCases/Linux/quiet-start.cc new file mode 100644 index 000000000..08d3a8acc --- /dev/null +++ b/test/xray/TestCases/Linux/quiet-start.cc @@ -0,0 +1,22 @@ +// Ensure that we have a quiet startup when we don't have the XRay +// instrumentation sleds. +// +// RUN: %clangxx -std=c++11 %s -o %t %xraylib +// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1" %run %t 2>&1 | \ +// RUN: FileCheck %s --check-prefix NOISY +// RUN: XRAY_OPTIONS="patch_premain=true verbosity=0" %run %t 2>&1 | \ +// RUN: FileCheck %s --check-prefix QUIET +// RUN: XRAY_OPTIONS="" %run %t 2>&1 | FileCheck %s --check-prefix DEFAULT +#include + +using namespace std; + +int main(int, char**) { + // NOISY: {{.*}}XRay instrumentation map missing. Not initializing XRay. + // QUIET-NOT: {{.*}}XRay instrumentation map missing. Not initializing XRay. + // DEFAULT-NOT: {{.*}}XRay instrumentation map missing. Not initializing XRay. + cout << "Hello, XRay!" << endl; + // NOISY-NEXT: Hello, XRay! + // QUIET: Hello, XRay! + // DEFAULT: Hello, XRay! +} diff --git a/test/xray/lit.cfg b/test/xray/lit.cfg index b07dcbd79..2852bdb74 100644 --- a/test/xray/lit.cfg +++ b/test/xray/lit.cfg @@ -31,6 +31,11 @@ config.substitutions.append( ('%clangxx_xray', build_invocation(clang_xray_cxxflags))) config.substitutions.append( ('%llvm_xray', llvm_xray)) +config.substitutions.append( + ('%xraylib', + ('-lm -lpthread -ldl -lrt -L%s ' + '-Wl,-whole-archive -lclang_rt.xray-%s -Wl,-no-whole-archive') + % (config.compiler_rt_libdir, config.host_arch))) # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] -- cgit v1.2.3