From 7fc524fe080a69e79bd1ce8925e680350b7e9d44 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Sun, 19 May 2024 02:43:55 -0700 Subject: [ctx_profile] Pass lib path into test Fixes build after cfe9deb1353021a1c1fe4731ec3e90f702dbd43d on https://lab.llvm.org/buildbot/#/builders/37/builds/34828 --- compiler-rt/test/ctx_profile/TestCases/generate-context.cpp | 2 +- compiler-rt/test/ctx_profile/lit.cfg.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'compiler-rt') 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) + ) +) -- cgit v1.1