[Lldb-commits] [lldb] 2ff533c - [lldb][JITLoaderGDB] Test debug support in JITLink
Stefan Gränitz via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 9 05:11:31 PST 2021
Author: Stefan Gränitz
Date: 2021-03-09T14:10:52+01:00
New Revision: 2ff533cba18af853fa0688c101f7ac7e7b594db7
URL: https://github.com/llvm/llvm-project/commit/2ff533cba18af853fa0688c101f7ac7e7b594db7
DIFF: https://github.com/llvm/llvm-project/commit/2ff533cba18af853fa0688c101f7ac7e7b594db7.diff
LOG: [lldb][JITLoaderGDB] Test debug support in JITLink
LLVM OrcJIT is shifting from RuntimeDyld to JITLink. Starting with D96627 I am planning to add debug support. It would be great to have test coverage for it in LLDB early on.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D96634
Added:
lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test
lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test
Modified:
Removed:
lldb/test/Shell/Breakpoint/jitbp_elf.test
################################################################################
diff --git a/lldb/test/Shell/Breakpoint/jitbp_elf.test b/lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test
similarity index 54%
rename from lldb/test/Shell/Breakpoint/jitbp_elf.test
rename to lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test
index c637dba75b05..ccaf9d4b96c2 100644
--- a/lldb/test/Shell/Breakpoint/jitbp_elf.test
+++ b/lldb/test/Shell/Breakpoint/jit-loader_jitlink_elf.test
@@ -1,11 +1,16 @@
# REQUIRES: target-x86_64
# XFAIL: system-windows
-# RUN: %clang -g -S -emit-llvm --target=x86_64-unknown-unknown-elf -o %t.ll %p/Inputs/jitbp.cpp
-# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' -o 'run -jit-kind=mcjit %t.ll' lli | FileCheck %s
+# JITLink is the Orc-specific JIT linker implementation.
+#
+# RUN: %clang -g -S -emit-llvm -fPIC --target=x86_64-unknown-unknown-elf \
+# RUN: -o %t.ll %p/Inputs/jitbp.cpp
+# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' \
+# RUN: -o 'run --jit-kind=orc-lazy --per-module-lazy --jit-linker=jitlink %t.ll' \
+# RUN: lli | FileCheck %s
# CHECK: Breakpoint 1: no locations (pending).
-# CHECK: (lldb) run -jit-kind=mcjit {{.*}}/jitbp_elf.test.tmp.ll
+# CHECK: (lldb) run {{.*}}
# CHECK: Process {{.*}} stopped
# CHECK: JIT(0x{{.*}})`jitbp() at jitbp.cpp:1:15
# CHECK: -> 1 int jitbp() { return 0; }
diff --git a/lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test b/lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test
new file mode 100644
index 000000000000..7f1bd9dadbdc
--- /dev/null
+++ b/lldb/test/Shell/Breakpoint/jit-loader_rtdyld_elf.test
@@ -0,0 +1,24 @@
+# REQUIRES: target-x86_64
+# XFAIL: system-windows
+
+# RuntimeDyld can be used to link and load emitted code for both, MCJIT and Orc.
+#
+# RUN: %clang -g -S -emit-llvm --target=x86_64-unknown-unknown-elf \
+# RUN: -o %t.ll %p/Inputs/jitbp.cpp
+#
+# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' \
+# RUN: -o 'run --jit-kind=mcjit %t.ll' \
+# RUN: lli | FileCheck %s
+#
+# RUN: %lldb -b -o 'settings set plugin.jit-loader.gdb.enable on' -o 'b jitbp' \
+# RUN: -o 'run --jit-kind=orc-lazy --per-module-lazy --jit-linker=rtdyld %t.ll' \
+# RUN: lli | FileCheck %s
+
+# CHECK: Breakpoint 1: no locations (pending).
+# CHECK: (lldb) run {{.*}}
+# CHECK: Process {{.*}} stopped
+# CHECK: JIT(0x{{.*}})`jitbp() at jitbp.cpp:1:15
+# CHECK: -> 1 int jitbp() { return 0; }
+# CHECK: ^
+# CHECK: 2 int main() { return jitbp(); }
+# CHECK: Process {{.*}} launched: {{.*}}
More information about the lldb-commits
mailing list