aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-05-19 02:43:55 -0700
committerVitaly Buka <vitalybuka@google.com>2024-05-19 02:55:40 -0700
commit7fc524fe080a69e79bd1ce8925e680350b7e9d44 (patch)
tree263351d7a3fc2b9eb05298ed150517bedbe4bc33
parent689bba1eec31fa236e2febaa4bcf46bc89ba432b (diff)
downloadllvm-7fc524fe080a69e79bd1ce8925e680350b7e9d44.zip
llvm-7fc524fe080a69e79bd1ce8925e680350b7e9d44.tar.gz
llvm-7fc524fe080a69e79bd1ce8925e680350b7e9d44.tar.bz2
[ctx_profile] Pass lib path into test
Fixes build after cfe9deb1353021a1c1fe4731ec3e90f702dbd43d on https://lab.llvm.org/buildbot/#/builders/37/builds/34828
-rw-r--r--compiler-rt/test/ctx_profile/TestCases/generate-context.cpp2
-rw-r--r--compiler-rt/test/ctx_profile/lit.cfg.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp b/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp
index 981d617..797b871 100644
--- a/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp
+++ b/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp
@@ -5,7 +5,7 @@
// RUN: cp %llvm_src/include/llvm/ProfileData/CtxInstrContextNode.h %t_include/
//
// Compile with ctx instrumentation "on". We treat "theRoot" as callgraph root.
-// RUN: %clangxx %s -lclang_rt.ctx_profile -I%t_include -O2 -o %t.bin -mllvm -profile-context-root=theRoot
+// RUN: %clangxx %s %ctxprofilelib -I%t_include -O2 -o %t.bin -mllvm -profile-context-root=theRoot
//
// Run the binary, and observe the profile fetch handler's output.
// RUN: %t.bin | FileCheck %s
diff --git a/compiler-rt/test/ctx_profile/lit.cfg.py b/compiler-rt/test/ctx_profile/lit.cfg.py
index bf62093..3034fad 100644
--- a/compiler-rt/test/ctx_profile/lit.cfg.py
+++ b/compiler-rt/test/ctx_profile/lit.cfg.py
@@ -33,3 +33,10 @@ config.suffixes = [".c", ".cpp", ".test"]
config.substitutions.append(
("%clangxx ", " ".join([config.clang] + config.cxx_mode_flags) + " -ldl -lpthread ")
)
+
+config.substitutions.append(
+ (
+ "%ctxprofilelib",
+ "-L%s -lclang_rt.ctx_profile%s" % (config.compiler_rt_libdir, config.target_suffix)
+ )
+)