[PATCH] D141824: [clang-repl] Add a command to load dynamic libraries
Stefan Gränitz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 23 05:21:30 PDT 2023
sgraenitz added a comment.
Thanks for the update
================
Comment at: clang/test/Interpreter/dynamic-library.cpp:1
+// RUN: head -n 7 %s | %clang -xc++ -o %T/libdynamic-library-test.so -fPIC -shared -
+int ultimate_answer = 0;
----------------
The use of `head` and `tail` here is a creative solution, but I wonder how well it scales for similar cases in the future in case this becomes a role model. We have this situation a lot in LLDB: compile an input file and use the output in a RUN line. It typically uses separate input files for such purposes (note that "Inputs" folders must be excluded from test discovery somewhere in lit config), e.g.:
https://github.com/llvm/llvm-project/blob/release/16.x/lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test
What do you think?
================
Comment at: clang/test/Interpreter/dynamic-library.cpp:9
+
+// REQUIRES: host-supports-jit, system-linux
+// RUN: tail -n 16 %s | env LD_LIBRARY_PATH=%T:$LD_LIBRARY_PATH clang-repl | FileCheck %s
----------------
This requirement applies to the entire file right? The arrangement here may imply the opposite.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141824/new/
https://reviews.llvm.org/D141824
More information about the cfe-commits
mailing list