[llvm] 25976e8 - Revert "[llvm-jitlink] Replace IR backtrace symbolication testcase with asm." (#175242)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 9 13:17:49 PST 2026
Author: Daniel Thornburgh
Date: 2026-01-09T21:17:45Z
New Revision: 25976e83606f1a7615e3725e6038bb53ee96c3d5
URL: https://github.com/llvm/llvm-project/commit/25976e83606f1a7615e3725e6038bb53ee96c3d5
DIFF: https://github.com/llvm/llvm-project/commit/25976e83606f1a7615e3725e6038bb53ee96c3d5.diff
LOG: Revert "[llvm-jitlink] Replace IR backtrace symbolication testcase with asm." (#175242)
Reverts llvm/llvm-project#175117
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-commits
mailing list