static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs) {
- // Do not add the XRay runtime to shared libraries.
- if (Args.hasArg(options::OPT_shared))
- return false;
-
if (Args.hasFlag(options::OPT_fxray_instrument,
options::OPT_fnoxray_instrument, false)) {
CmdArgs.push_back("-whole-archive");
CmdArgs.push_back("-no-whole-archive");
return true;
}
-
return false;
}
+++ /dev/null
-// RUN: %clangxx -shared -fPIC -o /dev/null -v -fxray-instrument %s 2>&1 | \
-// RUN: FileCheck %s --check-prefix=SHARED
-// RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s 2>&1 -DMAIN | \
-// RUN: FileCheck %s --check-prefix=STATIC
-// RUN: %clangxx -static -fPIE -o /dev/null -v -fxray-instrument %s 2>&1 \
-// RUN: -DMAIN | FileCheck %s --check-prefix=STATIC
-//
-// SHARED-NOT: {{clang_rt\.xray-}}
-// STATIC: {{clang_rt\.xray-}}
-int foo() { return 42; }
-
-#ifdef MAIN
-int main() { return foo(); }
-#endif