[compiler-rt] 7fc524f - [ctx_profile] Pass lib path into test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 02:55:49 PDT 2024


Author: Vitaly Buka
Date: 2024-05-19T02:55:40-07:00
New Revision: 7fc524fe080a69e79bd1ce8925e680350b7e9d44

URL: https://github.com/llvm/llvm-project/commit/7fc524fe080a69e79bd1ce8925e680350b7e9d44
DIFF: https://github.com/llvm/llvm-project/commit/7fc524fe080a69e79bd1ce8925e680350b7e9d44.diff

LOG: [ctx_profile] Pass lib path into test

Fixes build after cfe9deb1353021a1c1fe4731ec3e90f702dbd43d on
https://lab.llvm.org/buildbot/#/builders/37/builds/34828

Added: 
    

Modified: 
    compiler-rt/test/ctx_profile/TestCases/generate-context.cpp
    compiler-rt/test/ctx_profile/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp b/compiler-rt/test/ctx_profile/TestCases/generate-context.cpp
index 981d6170091c5..797b871860655 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 bf62093601f11..3034fadbb7a61 100644
--- a/compiler-rt/test/ctx_profile/lit.cfg.py
+++ b/compiler-rt/test/ctx_profile/lit.cfg.py
@@ -33,3 +33,10 @@ def get_required_attr(config, attr_name):
 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)
+    )
+)


        


More information about the llvm-commits mailing list