[llvm-branch-commits] [llvm] 72b3a5b - Revert "[llvm-jitlink] Replace IR backtrace symbolication testcase with asm. …"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jan 9 12:47:09 PST 2026
Author: Daniel Thornburgh
Date: 2026-01-09T12:47:03-08:00
New Revision: 72b3a5b440f888eb1aba7b8ee9ec85e15f1a52f3
URL: https://github.com/llvm/llvm-project/commit/72b3a5b440f888eb1aba7b8ee9ec85e15f1a52f3
DIFF: https://github.com/llvm/llvm-project/commit/72b3a5b440f888eb1aba7b8ee9ec85e15f1a52f3.diff
LOG: Revert "[llvm-jitlink] Replace IR backtrace symbolication testcase with asm. …"
This reverts commit 451ca458cf51d553f5c49e67d841280e8166f933.
Added:
llvm/test/ExecutionEngine/JITLink/Generic/backtrace-symbolication.ll
Modified:
Removed:
llvm/test/ExecutionEngine/JITLink/AArch64/backtrace-symbolication.s
################################################################################
diff --git a/llvm/test/ExecutionEngine/JITLink/AArch64/backtrace-symbolication.s b/llvm/test/ExecutionEngine/JITLink/AArch64/backtrace-symbolication.s
deleted file mode 100644
index 4792a6e5b0207..0000000000000
--- a/llvm/test/ExecutionEngine/JITLink/AArch64/backtrace-symbolication.s
+++ /dev/null
@@ -1,42 +0,0 @@
-# RUN: rm -rf %t && mkdir -p %t
-# RUN: llvm-mc -triple=arm64-apple-darwin -filetype=obj -o %t/crash.o %s
-# RUN: not --crash llvm-jitlink -debugger-support=false \
-# RUN: -write-symtab %t/crash.symtab.txt %t/crash.o \
-# RUN: > %t/backtrace.txt 2>&1
-# RUN: llvm-jitlink -symbolicate-with %t/crash.symtab.txt %t/backtrace.txt \
-# RUN: | FileCheck %s
-
-# Deliberately crash by dereferencing an environment variable that should never
-# be defined, then symbolicate the backtrace using the dumped symbol table.
-
-# REQUIRES: system-darwin && native
-
-# CHECK: this_should_crash {{.*}} ({{.*}}crash.o)
-
- .build_version macos, 26, 0
- .section __TEXT,__text,regular,pure_instructions
- .globl _this_should_crash
- .p2align 2
-_this_should_crash:
- stp x29, x30, [sp, #-16]!
- adrp x0, l_.str at PAGE
- add x0, x0, l_.str at PAGEOFF
- bl _getenv
- ldrsb w0, [x0]
- ldp x29, x30, [sp], #16
- ret
-
-
- .globl _main
- .p2align 2
-_main:
- stp x29, x30, [sp, #-16]!
- bl _this_should_crash
- ldp x29, x30, [sp], #16
- ret
-
- .section __TEXT,__const
-l_.str:
- .asciz "a thousand curses upon anyone who dares define this"
-
-.subsections_via_symbols
diff --git a/llvm/test/ExecutionEngine/JITLink/Generic/backtrace-symbolication.ll b/llvm/test/ExecutionEngine/JITLink/Generic/backtrace-symbolication.ll
new file mode 100644
index 0000000000000..d5604581f0a2d
--- /dev/null
+++ b/llvm/test/ExecutionEngine/JITLink/Generic/backtrace-symbolication.ll
@@ -0,0 +1,30 @@
+; RUN: rm -rf %t && mkdir -p %t
+; RUN: llc -relocation-model=pic -filetype=obj -o %t/crash.o %s
+; RUN: not --crash llvm-jitlink -debugger-support=false \
+; RUN: -write-symtab %t/crash.symtab.txt %t/crash.o \
+; RUN: > %t/backtrace.txt 2>&1
+; RUN: llvm-jitlink -symbolicate-with %t/crash.symtab.txt %t/backtrace.txt \
+; RUN: | FileCheck %s
+
+; Deliberately crash by dereferencing an environment variable that should never
+; be defined, then symbolicate the backtrace using the dumped symbol table.
+
+; UNSUPPORTED: system-windows
+
+; CHECK: this_should_crash {{.*}} ({{.*}}crash.o)
+
+ at .str = private constant [52 x i8] c"a thousand curses upon anyone who dares define this\00", align 1
+
+define i32 @this_should_crash() {
+ %1 = call ptr @getenv(ptr noundef @.str)
+ %2 = load i8, ptr %1, align 1
+ %3 = sext i8 %2 to i32
+ ret i32 %3
+}
+
+declare ptr @getenv(ptr)
+
+define i32 @main(i32 %argc, ptr %argv) {
+ %r = call i32 @this_should_crash()
+ ret i32 %r
+}
More information about the llvm-branch-commits
mailing list